That’s a great question.
Actually there are several reasons as to why whales are unable to live on land.
First, most species of whale have very large bodies that weigh thousands of pounds.
In fact the blue whale (the largest animal in existence) can weigh in excess of 150 tons and grow to be over 100 ft. long!
Their bodies are not designed to hold that kind of weight on land, which is a non buoyant environment.
After only a few minutes on land the whales own body weight would crush its organs without the buoyancy and weightlessness of the ocean to hold it up.
Second, due to the thick layer of blubber (over 1 ft. of blubber in some species) and lack of water the whale would quickly overheat, get dehydrated and dry out.
In fact this is commonly seen among beached whales that end up dying due to heat exhaustion.
The cool temperature of the water is essential for their survival.
Third, whales lack any appendages that would allow them to move on land and would not be able to hunt for food, navigate the land or travel back to the ocean if they were to end up on land, hence why whales end up getting stuck and beached.
Even if a whale could walk on land some species (such as the great whales) would simply be too large to navigate most non aquatic environments on earth.
Not only would these marine mammals need to develop the bone structure and muscles necessary to hold their massive bodies up and keep their vital organs from being crushed under its own weight, but they would also need to find enough open space to walk around.
Fourth, most whales consume a very large amount of food on a daily basis.
For example the blue whale can eat as much as 40 million krill per day and many species consume anywhere from 2% – 10% of their body weight in food every day.
Even if a whale could consume enough small food to fill its daily requirements there is no guarantee that its body wouldn’t have trouble digesting the food as their bodies have been adapted to eating and digesting certain types of aquatic life, not the types of animals most land mammals consume.
Most whales have small throats so the type and size of food they could consume would be fairly limited.
This issue would be even more difficult for baleen whales due to the fact that they are filter feeders and would be incapable of chewing or biting their food because they do not possess teeth.
As you can see there are many different challenges whales would have to overcome to be able to survive on land.
Before ending this post it should be noted that in the past the ancestors of whales did live, hunt and survive on land.
Signs of their land dwelling past can often be seen in their bone structure.
For instance the spine of these marine mammals bends vertically and appears to have originally been designed for running, not swimming.
They also have bones with individual digits hidden underneath their flippers that appear to have been used for walking and hunting on land.
Aside from their bone structure whales are warm-blooded and breathe air as compared to fish that are typically cold-blooded and possess gills used to extract oxygen from the water.
Throughout the course of millions of years these animals slowly evolved from land dwelling mammals to the ocean bearing marine mammals we now know today.
Just as their ancestors evolved from land dwelling mammals to marine animals; it would take whales millions of years to evolve back into land animals.
For more information on that topic check out this article on the history of cetaceans: The evolution of whales.