You may want to read this answer while listening to a poetic song by Andrzej Sikorowski and Grzegorz Turnau, called "Nie przenoście nam stolicy do Krakowa", what means "Please don't move the capital back to Kraków", written in the 90's, after the end of communist era in Eastern Europe, when some politics started to express such ideas.
Digressions
I've decided to cut my answer a lot in comparison with what I've written off-line, in order to provide the most direct answer to the actual question. But for the background, few things need to be clarified, so I'll at least point it in short without providing details.
The previous capital before Krakow was Gniezno, the role of which for Polish history is somewhat similar to that of Canterbury for England or Reims for France. Even if Krakow was the center of political power from 11th century, it became the factual capital in 1320, with the coronation of Wladyslaw I the Elbow-high.
Also the role of Krakow as the center of political power before 1320 wasn't always clear. This happened because of very complexed internal situation of Poland (which was divided into many smaller parts) between 11th and 14th centuries and because of different role of capital in medieval Poland that we understand it recently. There are also towns Poznan and Plock, which proudly use the title of capital city, because they were also centers of political power in various periods before 1320.
Now as for Warsaw becoming the capital. The court of Sigismund III Vasa was moved to Warsaw in 1595 from the highly interesting reason including the results of alchemical experiment, which is unfortunately not a matter of this question. But it was only short, temporal change - the permanent move was made by him in 1609, also from few different reasons. Still, the official capital of Poland was Krakow, what led to several awkward situations and even national scandals. So officially, Warsaw was never described in any documents as a capital until Grodno Sejm in 1793, two years before Poland vanished from the maps of Europe.
I will be extremely happy to describe all of that if any adequate questions happen in the future. :)
(source: raremaps.com)
Page from Liber Chronicum by Hartmann Schedel, 1493, with his illustration of Kraków, Jewish town Kazimierz and royal Wawel Castle
Fall of Krakow in 17th century
Speaking of why Krakow didn't become a capitol once again, we have to go back as far as to second part of 17th century. Note that we don't go back to the first part. Because even if the court moved to Warsaw, it didn't stop Krakow from development, thanks to its important role at the trading map of Europe.
Unfortunately, bad things started to happen with the enthronement of John II Casimir Vasa in 1648 (in my opinion the worst kings of Poland if not to count Russians which we just don't legitimize because we didn't chose them).
It started with a fire at Wawel Castle in 1649, which wasn't anything unusual, but let's count it as a prelude. Soon there came Khmelnytsky Uprising in Ukraine and at the same time Peasant Uprising of 1651 almost at the fields of Krakow. In 1652, nearly 20000 citizens of Krakow agglomeration died in smallpox epidemy, which was quickly followed by one of the biggest floods in town's history. And as if it wouldn't be enough, during the so called Deluge (Swedish invasion) Krakow was sieged, ruined and looted with its surroundings two times in 1655 and 1657.
After that decade, Krakow just wasn't the same anymore. Of course it slowly raised, but in overall, demographic and economic development of the town stopped for many years.
Siege of Krakow according to Samuel Pufendorf, 1695, click here for full resolution
Role of Krakow during Partitions of Poland
Like I've written previously, in 1795 Poland vanished from map of Europe for 123 years because of so called Partitions. At the beginning, Krakow became a free city on the border of three occupants - Austria, Prussia and Russia. But after unsuccessful Krakow Uprising during Spring of Nations in 1846, it became part of Austria.
And it wasn't even the most important town of its region, as the capital ofKingdom of Galicia and Lodomeria became Lviv.
There were both advantages and disadvantages of such situation. On one hand, there was much bigger freedom in Krakow than in Warsaw and other Russian or Prussian towns. Austro-Hungarian Empire just didn't have enough forces to control everything in its borders, especially when they had to deal with many other nations (see map below). This led to development of Krakow once again as the cultural, artistic and historical heart of Polish nation in those difficult times.
On the other hand, Galicia became poor in comparison with other Polish regions, especially Greater Poland. Austrians were spending much more money to satisfy others, e.g. raising from the ground Budapest after Hungarian Revolution of 1848.
By that time, Krakow itself was a very small town, surrounded by few other ones (Stradom, Kazimierz, Kleparz) and a new one - Podgorze, founded by Austrians on the other side of Vistula river. Also the town of Krakow was mainly covered by churches and monasteries, from which many weren't even used. It was a difficult task with not always right decisions to reform it into modern, big town. And even if local government was finally successful to realize it, it was still much smaller than other towns.
Role of Warsaw during Partitions of Poland
In the times of Partitions, Warsaw become capital of two countries. Firstly, capital of Duchy of Warsaw, which existed between 1807 and 1815, until Napoleon's fall. Later, of Congress Poland, the name of which comes from the Congress of Vienna.
This way Warsaw was still developing as center of political power, at least at the local level, as it didn't have any own foreign politics and was completely dependent on Russia, with Russian tsar being at the same time king of Poland.
During World War I Warsaw became capital of Regency Kingdom of Poland (founded by Germans and Austrians on the lands of Russian partition) and after the end of it, which meant rise of the Second Polish Republic, Warsaw was also a natural choice for a capital city. Rapid development of the town continued for 20 years between the wars.
As far as I hate to admit it, in comparison to Warsaw, Krakow was at that time rather a province.
Here are the numbers of citizens in Polish towns in 1939, at the beginning of World War II:
Warsaw – 1,289,000
Łódź – 672,000
Lwów – 318,000 (recently in Ukraine)
Poznań – 272,000
Kraków – 259,000
Wilno – 209,000 (recently in Lithuania)
Greetings from Warsaw, postcard dated before 1939
Krakow and Warsaw during World War II
I skip all the history of the war, except for the fact that Warsaw was meant by Germans to be completely demolished and replaced by a new town for German elite with around 100000 citizens. This way during all the war the destroying continued and didn't stop even in 1945. From 1.3 million of citizens, 700 thousands were killed during the war (300 thousands of them being Jews). Here you can see collection of photos showing Warsaw after the war.
At the same time Krakow was as a capital of new General Goverment, as Germans treated it as a previously German town. It was also the central place for German garrison in Poland, what made any tries of uprising in Krakow impossible. This way, speaking about buildings, the town survived rather untouched, of course if not to count Jewish district Kazimierz which was destroyed.
View of Warsaw after World War II
After World War II
So finally we come to the times after the war.
First of all, were communists thinking about moving the capital from Warsaw? Of course they were. But surprisingly, the rival of Warsaw wasn't Krakow, but city of Lodz. Being the biggest at the time, after the fall of Warsaw, and very close to it, what meant the same, central position in a newly established country, it quickly started to serve as a new cultural center with new universities, theaters, cinemas and artists passing the main Piotrkowska Street.
Another reason for which Lodz was taken into account was a large amount of big, empty buildings, perfect for new government offices. During the war Lodz lost around 300000 of Jews (after Warsaw, Lodz had the biggest Jewish population in Poland), 120000 of Poles and 80000 of Germans who left the town together with German army. But before the end of 1945, the population once again raised from 300000 to 500000.
This way many official agencies moved to this town quickly after the war. It resulted with Lodz being a center of political power between years 1945 and 1948, when the main offices went back to Warsaw.
Other towns on the list were Poznan and of course Krakow. But Krakow wasn't a good option for communists from different reason. Krakow was a town of intelligence, lying in Lesser Poland which was also the most religious region. Even after the war, when intelligence of Poland was crushed, it was still too strong to change it into a communist one and the support for left-winged politics was the lowest in the country.
It was proven in 1946, during the People's Referendum, when the communist party PPR organized huge campaign to vote 3 x yes. Later it took them 12 days to falsify the results in order to prove that the country accepts the new politic order. But in Krakow and other towns of Lesser Poland original results were announced and they were opposite:
The official results, published on 12 July 1946, showed that from a population of 13,160,451 eligible voters, 90.1% or 11,857,986 had taken part in the referendum. Of these, 11,530,551 or 97.2% were counted as valid. On the first question, 68% voters chose "yes". On the second question, 77.2% voted "yes". On the third question, 91.4% voted "yes".
(...)
In Kraków, where the opposition managed to ensure a fair vote, the "no" results were: 84%, 59% and 30% for all three questions.
In opposite, Lodz was not only biggest and in the center of the country, but also a modern worker's city. What a perfect match for new, communist government. In the end, the vision of creating whole new town suited the needs of communist government the most, as they would be able to build it fully under their control and to unite the country over the rebuild of the capital under the communist flag.
Now who made the final decision? Of course Stalin. Son of Edward Osóbka-Morawski, Prime Minister of Provisional Government of the Republic of Poland which ruled Poland after the war, describes it in Gazeta Wyborcza newspaper in the following words (translated by me):
Bierut (chairman of State National Council) had an opinion that the state of city's devastation justifies the move of capital and his proposition was Lodz. The Council of Ministers, of which my father was a leader, insisted on rebuilding of Warsaw. Because of lack of agreement the case was decided by Stalin, who gave support to my father.
When Bierut came back from Moscow in January of 1945, he told the government that Stalin wants Warsaw to be rebuilt and offers his help.
Surprisingly among the people who opted for Warsaw was Marian Spychalski, born in Lodz and the last mayor of Warsaw at the time of war.
Finally, Warsaw became a constitutional capital of Poland in 1952, as says the text of Constitution of the People's Republic of Poland:
Article 105
Warsaw, a city which embodies the heroic traditions of the
Polish Nation, shall be the capital of the Republic of Poland.