Just before his surprise resignation, Liberal Democrat leader Sir Menzies Campbell blasted both the Labour and Conservative parties for failing to provide adequate housing for the armed forces, despite the current difficulties in retaining staff.

The families of armed forces personnel made 400,000 complaints to a call centre about their housing last year, according to research conducted by the Liberal Democrats.

The Ministry of Defence has estimated it would cost £750m to upgrade all family housing to the highest standard, and at least £50m a year to make necessary improvements.

However, according to the Lib Dems, the MoD spent just £16m in 2006-07 upgrading family homes to ‘Standard One’. At this level of spending it would take 50 years to upgrade every property.

The research found that there were more than two complaints for every member of the armed forces, with an average of nine calls for each property.

In addition, half of all single living accommodation is graded at the worst level by the Army’s Standard for Conditions.

Campbell said: “Both the Conservative and Labour governments should be ashamed of their failure to provide decent housing for the brave and dedicated young servicemen and women of our armed forces. It is a national scandal,” he said.

“When people are risking their lives for their country in Iraq and Afghanistan the least that they can expect is decent housing. Instead they are provided with shabby accommodation that will take years to fix. It is no wonder that so many key posts in the forces are unfilled,” he added.

Last month MPs warned the MoD that the state of domestic barracks is “unacceptable”.

Overall, the ministry said it spent £700m on housing and accommodation last year, and said it expected to spend £5bn in the next decade.