There's a few reasons. For one, Italy's geography doesn't particularly lend itself to northward offensives. Its narrow and mountainous nature meant that a relatively small number of defending Germans could stall Allied pushes. The progress the Allies had made thus far was slow and costly.
For another, for the Allies to really be able to push forward they needed to establish a more consolidated supply line--the long way around Spain, through Africa and sometimes Sicily to the Italian front was inefficient. Having a beachhead--and eventually a port city, like Caen, Le Havre, or Cherbourg--meant that the Allies could more easily supply their troops.
Another, more political reason is that the Soviets were clearly pushing forward. Going all the way from central Italy to try to beat the Russians to Berlin would leave the Allied flanks open to attacks from German forces in France, Austria, and Eastern Europe. They needed a more direct--and more defensible--route to the German capital.
Sources: (Both great reads on the subject!) D-Day (Stephen Ambrose) D-Day (Anthony Beevor)