For many things this is true nowadays. Where I live walking in nature or swimming in the ocean is still free. In Dubai nature as in a green park might raise an entry fee.
Arguably Dubai shouldn’t exist as a place where many humans live.
Why not? They are doing many things right, and unlike in many parts of the west, their leadership are investing heavily in their own citizenry and nation, and have a long term vision.
I mean more in the context of millions of people living in the middle of the desert
Dubai is not really in the "middle of the desert". Dubai is a coastal city.