OSX Mail - Folder Locations
On iCloud/Google Apps you didn’t create the folders under “Inbox”, and so they appear further down in the pane you’ve screenshotted.

On the Exchange server you did create folders under the “Inbox”, and therefore that is where Mail.app displays them.

On my Zoho (IMAP account), I can either use the web client to create folder under the Inbox, or use Mail.app by ctrl+click on the Inbox I want to create a folder under and selecting “New mailbox...”, in the window that appears prefix the Name of the folder you want to create with “Inbox/” e.g. Inbox/foo.
I tried the above on my iCloud account, but it didn’t seem to work.