I don't understand why NASA, European Space Agency, ISRO etc. spend enormous amount of money/time on space exploration. Why can't they spend it on the medical side and invent vaccines to incurable diseases like CORONA, small pox (may be reborn) etc.
You claim that space agencies around the world "spend enormous amounts of money" and seem to imply that this money is wasted. Factually though, this is untrue.
NASA's budget per year is around 22 billion dollars. That's only around 0.5% of the US's annual budget. For comparison, the DoD gets north of 600 billion dollars a year. That's around 15% of the annual US budget, outspending China, India, Russia, and most of the EU combined. Furthermore, budget isn't a zero-sum game. Just because you increase the budget somewhere, doesn't mean it needs to shrink elsewhere--NASA isn't "stealing" budget away from other causes.
Space agencies provide a real service. For example, GPS, something that millions--if not billions--of people around the globe use almost daily, would not be possible without space agencies. Also, things like satellite television or global communication would also likely not exist if space agencies hadn't given them a hand.
Science in space helps us here on Earth. Satellites monitor our planet, providing immediate data in the form of weather forecasting and storm tracking. Additionally, satellite data is also invaluable for disaster relief, tracking hurricanes, etc. Besides short-term data, Earth-observation and Earth-science satellites also provide things like maps, climate data, and data to combat global warming.
The inventions, innovations, and science that comes out of space agencies have indirect fiscal benefits to society. It's estimated that for every single dollar we spend on NASA, we see between 7 and 14 dollars return to the US economy in the form of revenue. This comes mostly from spinoff startups or technology.
The space industry employs a lot of people. In the USA, over 100,000 people's jobs are directly dependent on space.
Research in the field of human health in zero gravity can be very valuable. You say "Why can't they spent on medical side and invent vaccines to incurable diseases" but NASA already does this by providing zero-g facilities for pharmaceutical companies. Performing medical science in space allows things that aren't possible here on Earth, including researching new vaccines.