Was it about local issues, or the national government? If the latter, what's the problem - have they just been in power too long, or could it be something specific like Blair's part in the Iraq debacle (and his ongoing lap-doggery)? Was there a sympathy vote for Charles Kennedy?
The Liberal Democrats and their previous incarnation the Liberal Party have a history of upsets in by-elections.Theirs is the party you turn to, just the once, if you are Labour but do not want to vote for Labour or Conservative but do not want to vote for the Conservatives.
By-elections (1) give the electorate the chance to get an MP whom they think is good, rather than someone foisted on them by the political party that has held the seat. Nationally, whether the Labour candidate or MP is good, bad , or indifferent, the electorate feels obliged to think and vote nationally. If they want a Labour government nationally then that is not the time to vote for the Lib-Dems or the Tories.Sometimes these individuals who win in by-elections get re-elected simply because they are good MPs. Simon Hughes, a contender for leader of the Lib-Dems, himself won a by-election by defeating Labour in the safe Labour seat of Bermondsey over twenty year ago. That was a shock then but his merits as their MP have ensured that the local voters have supported him ever since.
2) allow the electorate can protest over local issues without affecting the government. They can get themselves noticed nationally and by national government. In the instant case, if the locals were looking for results over local issues then, in nearly every instance these were beyond the remit of a Westminster MP. These were matters for their member in the Scottish assembly in Edinburgh, not the British one in London, but who cares about such niceties? There were local issues here.
3) give an opportunity to make a mild, but unimportant, protest about the Government. What the voters decide there makes no difference nationally. In the instant case this element in the result is small compared to the others.
If this were truly a vote against the Government then you would expect it to reflect polls nationally. Nationally, whether that be Scotland or Britain, there is no sign of a 16% swing to the Liberal Democrats (nor any swing of note to anyone else, come to that)