Keep module folder structure for compendiums?

I’m not 100% sure about this, but I think Foundry by default (since I don’t remember which version) decided to go with alphabetical sorting by default instead of respecting the item’s sort order.
You need to right click on the folder, then edit, then change the sorting mode from alphabetical to manual. That should restore the order that they would have been in within the compendium.