IMHO the money could have been better spent but also might have been much worse spent. I'll take it.
Last but by no means least it provided a target for the nascent private space industry, leading to things like reusable rockets. That would have been possible without it, but it's being there helped.
Otoh, I've seen NASA ROI calculated anywhere from 5$ to 20$ per dollar spent. Hubbard places it at 8$. This article gives a good entry point to the topic http://www.21stcentech.com/money-spent-nasa-waste/