For the simple reason that you look up to the skies and wonder what is out there and what is to like being there. No expedition is hassle free or remotely close to safe. Human inquisitiveness coupled with a spirit of adventure is what turned many a people into hard core explorer. So cutting the long story short, it is pure passion and pride (atleast for the engineer s and astronauts who work space organisations, though the governments will have vested interest, including weapon projects).
Btw there are more dangerous jobs out there than being an astronaut (who said the life of one of BSF jawans are danger free! And catching up on that point, NASA budget is way way lower to US defense budget (for that matter most of the so called developed nations defence budget). The majority of wealth we have, we spend building our arsenals.
Another reason is to setup experiment stages for a better understanding and improvement of our current existing fundamental knowledges (starting from validating our understanding of the fabric of universe and the reality at a sub-atomic level to the acquiring information and inferences about universe has a whole). And personally I believe it is a money well spend, rather than on building the next weapon which will can annihilate millions of people effectively.