I've been reading a lot of Sun Tzu lately, and I was particularly interested in Part 3.4:
The rule is, not to besiege walled cities if it can possibly be avoided. The preparation of mantlets, movable shelters, and various implements of war, will take up three whole months; and the piling up of mounds over against the walls will take three months more.
But I've heard there were a lot of sieges during the medieval period, which makes me wonder if something was different during that time that made sieges a viable option. When would a siege be considered a good war strategy?
The key to Sun Tzu's advice is "...if it can possibly be avoided."
In conquest, certain sieges cannot be avoided. For instance, conquest practically necessitates the taking of the cities that command the region. Until then, the government stands, and you are merely a marauder. Take the seige of Warsaw in 1939; Germany sought to take control over all of Poland on their side of the demarcation line, so were pretty much obliged to besiege the city, which took the better part of a month.
The liberation of Warsaw at the other end of the war was a somewhat different matter. The Soviets were liberating Poland, not conquering it (whatever you might think of their post-war policy). They stopped short of the city in late 1944, seeing little advantage to besieging it at that time (rather controversially, since the Poles rose up in August in anticipation of Soviet aid, which never arrived). They then simply waited for the situation elsewhere to become untenable for the Germans who left the city in January. The Soviets then walked in unopposed.
Some sieges are strategically necessary. For instance, critical roads or other supply lines may be threatened by certain towns or strongholds, which would have to be subdued in order to allow operations beyond them. A good example was the 1945 siege of Poznan, which, while not medieval nevertheless had soldiers crossing ditches and assaulting stone walls with ladders, so it might as well have been. Poznan interfered with the supply lines between Warsaw and Berlin, so the Red Army had little choice but to besiege it to continue their advance.
These are comparatively recent examples, but the general strategic principle goes back to Sun Tzu (500 BC) and beyond, so there isn't anything particularly medieval about it. Sieges are costly and time-consuming, so you should make damn sure they advance your strategic position before committing to one. What the medieval world had that probably stands out to modern readers were several very long and very famous wars of conquest (the 100 Years War, the Crusades, the Reconquista, to name a few) which would have increased the strategic necessity and therefore the frequency of sieges.