The joke is a play on words.  The phrase 'just taking up space' means to be wasting a spot by being there when it doesn't matter to that person, or there would be nothing gained from it.  Astronomy is the study of space.
I thought about studying astronomy for university but I knew I would just be taking up space .