One of the problems that a coworker raised me this morning about the order of the desks on his new Mac, is precisely that they are ordered randomly when he has several open. Actually this is something from the system configuration and it comes by default on all activated Macs.
It is not something that happens to everyone since not all of us work with many desks at the same time (Although I recommend it) but in this case it is very easy to solve and we only have to access the system preferences in Mission Control.
Reorder the spaces automatically
This is basically what the Mac does when we close an application on a desktop. Many new users who come to Mac may even think that this is the case and it is impossible to change it, but it is as simple as accessing the System Preferences> Mission Control and uncheck the box that says: Automatically reorder spaces based on most recent usage.
Now when we close an application in macOS, this will no longer modify the order of our desks and we will not go crazy trying to find the desk we were working on again or reordering each one of them as we had it before, they will remain as is. The order is important for many users and with this option active it is practically impossible for this order of desktops to be maintained, since it is done automatically by the system itself.