There’s no shortage of malls in UAE, but also there’s fantastic infrastructure — great roads, a metro system, a country-wide rail system (open for cargo, opening for passengers soon). As for “vanity projects”, the Palm and both Burj’s are commercial projects that are also highly successful tourist draws. I can see an argument that the Abu Dhabi branches of the Louvre and the Guggenheim could be seen that way, but I think it’s fairer to see them as cultural investments.
I guess I see the unfinished projects as being the proof: The World and the 2nd Palm haven’t been finished because they (I assume) stopped making commercial sense to the developers.
I would finally note that Dubai specifically has little oil and gas wealth. Maybe 1% directly and 10% that comes as subsidy from AD which has plenty. The rest is literally just a combination of smart and commercially savvy governance combined with an essentially unlimited amount of desert to build in.