They are both amazing feats of human engineering? They both cost billions with little tangible benefit? They were both launched in a desert? Both mainly built by Western engineers?
No, they are both good examples of status races. The moon landing was all about competition with the Russians, not the great usefulness of moon rocks. And the Dubai tower is all about being the biggest tower of its day, not the most cost-effective way to house a few thousand people. They are symbols of relative power.
From the old economic point of view, they should not exist. Within the vast majority of models used in micro-economics and macro-economics (the personal material consumption model), both are wastes of resources. They are anomalies we in the past tried to avoid discussing too much.
Within behavioural economics, these are what actual consumption goods look like: things that make their owners feel good about themselves because they allow them to feel better than other people. The implied jealousy of the loser makes it all worthwhile. Even with decades of hindsight, people feel great about winning a status race and would do it again if given the opportunity. No cosmic Karma in which this kind of bragging is eventually punished, no role for modesty: it is about straightforward pride in having a bigger and better one than someone else.
The welfare implications of status races lead to interesting optimal policies: since status is a fixed-pie game (the more you have, the less someone else has), their very existence implies a missing market for mutual agreements not to waste energy on such projects. Ideally, a world government should tax countries for status expenses so as to encourage the people who otherwise waste time on them to spend more time with their family and friends. Doesn’t sound likely to happen soon, now does it?
As a finishing note, is it just me or have you also noticed how phallic status symbols often are? Boys and toys….