More broadly, if we include Mercury and Gemini, it was a tremendous success in the sense of developing Astronautics as a whole. I won’t cite specific spin-offs, but the impetus to land on the moon so rapidly necessarily meant learning how to do things like rendezvous and establish communication networks.
>”It was an artificially inflated exercise in national ego. In no way was it worth the money expended on it.”
There is way more to it than mere pride. President Kennedy and LBJ decided to push hard with the space race as a means of economic warfare against the Soviets. The strategy was twofold: one, to get the Soviets to commit resources to their own moonshot program when they otherwise would not. We were betting on our economy being stronger than theirs, and we could force them to catch up to us. Two, to develop American industry and expertise when we had clearly fallen behind. The spending might seem wasteful but it created a ton of jobs and bootstrapped our space industry. We essentially closed the whole “missile gap” in about 7 years as a result.