Awhile is an adverb, just one word meaning for a short time. A while, on the other hand, is a two-word noun phrase meaning a period of time. Some writers use the preposition for before awhile, but its definition clearly makes that use awkward. Just substitute the definition for the word, and you should see that for yourself.
Consider the example sentence in the cropped graphic above. If you replace the word awhile with its definition, you get an awkward construction: