'NASA' is actually an acronym that stands for 'National Aeronautics and Space Administration'. It's research purview includes space as you mentioned, but also the 'aeronautics' bit that you take issue with. NASA is awesome! You can learn about what they do (and to get to your point, why they do it) here:

https://www.nasa.gov/about/highlights/what_does_nasa_do.html

Educate yourself! You're already on the internet if you're reading this-go and benefit from the amazing things our tax dollars are being used to discover!