Where do you enable the option (if there's any) to automatically sort and line up the icons in a Finder window, when you resize it?
I have the default Windows behaviour in mind where the icons take all the available empty space of the window.
You can change the default sorting modes in the view options panel:
The folder selected before showing the view options doesn't matter. Use as Defaults changes the default sorting modes for all folders in the current view mode that haven't been sorted manually. Icon view, list view, column view, and cover flow view each have separate default settings.
When you change the Sort By or Arrange By modes of a folder manually in any way, Finder saves them to a .DS_Store file which overrides the default ones. It's less noticeable in column and list views where the current folder is the folder shown on the title bar, but the Sort By and Arrange By modes are saved for all normal folders in all view modes.
You can delete .DS_Store files with