The Liberal Democrats started planning for negotiations in the event of a hung parliament towards the end 2009, this was done secretly by Danny Alexander, David Laws, Chris Huhne and Andrew Stunell on the direction of Nick Clegg. Their consensus, pre-election, was that depending on electoral arithmetic a coalition with Labour or a "confidence and supply" with Tories were the best outcomes for the hung parliament regime where no party had an overall majority. However, Chris Huhne argued that coalition with the Tories was better than "confidence and supply". Confidence and supply means that the junior party supports the senior for votes of confidence, and for budgetary votes. Huhne argued that under these circumstances LibDems would get all of the blame for difficult government decisions which they supported, without any say over policy. The Tories set up a similar group approximately two weeks before the election comprising William Hague, Ed Llewellyn, George Osborne and Oliver Letwin. Labour apparently did no group planning, their negotiating team comprised Lord's Mandelson and Adonis (a former LibDem), Ed Balls, Ed Miliband and Harriet Harman. The civil service also seems to have been very well prepared to support negotiations and had a strong preference for coalition over other forms of government. There are strong hints that the civil service were deeply concerned at the prospect of a minority government, or a "confidence and supply" agreement would be bad for confidence in the economy.
The 2010 general election gave the Tories 306 seats, Labour 258, Liberal Democrats 57 and other parties 28 seats (including 8 DUP, 6 SNP, 5 Sinn Fein). This would give a Lib-Lab pact a majority over the Conservatives of 8 seats but with 28 votes with smaller parties so not technically a majority. A Tory-LibDem coalition gives 363 seats, with a majority over Labour of 105. Such a pact can take a rebellion (i.e. MPs of the coalition voting against it) of 35, in theory a Lib-Lab coalition could take no rebellion. In practice the 5 Sinn Fein MPs would likely not vote and the SNP would be unlikely to vote with Tories, except if there was something in it for Scotland.
This electoral maths suggest to me that the only real choice was what form the agreement with the Tories should take: no agreement - likely leading to a new election, "confidence and supply" or full coalition. Coalition with Labour looked really hairy in terms of numbers of seats but there was a lot of enthusiasm in the Liberal Democrats and some enthusiasm in Labour for this. The generation of LibDem MPs who had entered the parliament opposing Tory governments (Paddy Ashdown, Vince Cable, Charles Kennedy, Don Foster etc) were particularly keen. Gordon Brown was keen to form a coalition, and from the Labour team Mandelson and Adonis. Clearly from a negotiating point of view the fact that a coalition with Labour was feasible was a strong card to play.
Steve Richards, in The Independent, prefers to characterise the Coalition agreement between LibDem and Tory as the result of a take over by Orange Book Liberal Democrats, against the will of the party. This seems to misunderstand the internal workings of the party: both the parliamentary party (Commons and Lords) and the federal executive were consulted at the time on how negotiations should progress. They also voted on the outcome, as did the wider membership at a special conference held shortly thereafter. Many of these would be people just like me who would have been nervous of coalition with Tories, and many would have initially preferred coalition with Labour. However, ultimately all of these groups voted emphatically for coalition with the Tories. One striking thing in the whole process was the amount of time the LibDems spent on internal consultation - Labour apparently did none of this, and in the Tory party it was cursory and ad hoc.
Lord Adonis has disputed David Laws assertion that the Labour team were disengaged and unhelpful in the negotiating process, and largely supported the Richards view of an Orange Book take over. Laws has responded to that accusation. Personally I'm happy to accept David Laws view of the Labour stance in negotiations: the external signs from Labour were that there was a substantial lack of will to form coalition in the parliamentary party (Blunkett, Reid, Burnham, Darling apparently all against), and that little or no preparation had been made to try to negotiate a coalition should the opportunity arise. Why was this? Was it an oversight? Did they feel formation of a coalition with the Liberal Democrats was so trivial as not to require any preparation? The accusation that the Labour negotiation team may have been split flies because it is so self-evidently plausible. My view is that the Labour party as a whole were tired of government, could not face coalition with a non-existent majority and could not face the prospect of implementing the cuts required (and promised by them too) to address the deficit. There's no doubt that for some of them coalition with any other party, except with the most supine partner was anathema.