Those settings are stored in the hidden .DS_Store file that’s created the first time you open a folder. If the problem returns, delete it, and reset the view options. Details on showing hidden files are revealed by a google search for unhide files mac.