The decision of France and Britain to join the Taiping War is one of those somewhat out-of-the-blue affairs of the Late Qing period that really requires a bit of digging into. Sadly, I'm not aware of much work done on the French decision to go to war, at least in English, so this answer will focus primarily on the British decision to intervene in favour of the Qing.
The most recent narrative history of the Taiping period aimed at a popular audience, Stephen R. Platt's Autumn in the Heavenly Kingdom (2012), tackles this issue, and argues that the decision behind Britain's intervention was a two-stage process. Firstly, the outbreak of the American Civil War in 1861 caused an economic crisis for the British government, as the disintegration of their two major markets – China and the USA – threatened to grind their trade to a halt. As such, Britain needed to act fast and restore one of these markets, and opted to intervene in China. This, however, only explains why Britain intervened. Why on behalf of the Qing? Platt's position is that it was due to poor judgement on the part of particular individuals – the chief Taiping diplomat, Hong Rengan, didn't understand the British as much as he thought he did, and the chief British representative at Shanghai, Frederick Bruce, obstinately refused to give the Taiping the time of day. I agree halfway, in that I do think that the global angle regarding British exports makes sense (the disruption to the cotton and textile trade in China was also a factor in the escalation of the Opium War in 1840-42), but I think Platt gives the Qing too little credit, lets the Taiping too far off the hook, and understates the degree to which pro-Qing British officials were the norm rather than the exception.
First off, if we look at Qing policy vis-a-vis the Taiping, we find that the Imperial government did exceptionally well in courting and exploiting foreign support, whilst the Taiping never really managed to do the same. In the wake of the 1861 Xinyou palace coup against the regents of the five year-old Tongzhi Emperor, the late Xianfeng Emperor's brother, Yixin, who had in 1860 signed the Convention of Peking with Britain, France and Russia, established a formal foreign ministry, the Zongli Yamen, which was able to give some consistency to Qing foreign policy direction and a regular point of contact for foreign powers seeking to liaise with the Imperial government in Beijing. It is true that the Zongli Yamen was always a somewhat informal arrangement, being a small subordinate agency (only under the terms of the Boxer Protocol was a proper ministry for foreign affairs established), but at least it was a regular institution that provided a reliable channel of communication. By contrast, there was never any sort of official Taiping agency responsible for foreign affairs. At most there was Hong Rengan, who had personal connections to the Protestant missionary community and was the point of contact for foreign dignitaries, but after his ignominious removal from responsibility for Western affairs in 1861 – the same year the Qing established a formal office – there was simply no person, let alone institution, who could be pointed to as having ultimate responsibility for foreign relations. Everything was now handled through whomever was in command of whichever garrison or army Westerners were dealing with – usually Li Xiucheng, the 'Loyal King', who apart from a brief interlude in 1861 was mainly occupied with fighting the war in southern Jiangsu near Shanghai. And, if your consul at Shanghai's main point of contact with the rebels is a general whose main goal is to occupy Shanghai and its environs, your relations with them are hardly going to be on the friendliest of terms.
It's not like it had to end that way, either, but the Taiping just kept failing to capitalise on their early advantage of foreign contacts. In 1853 and 1854, the Taiping capital at Nanjing was approached four times by foreign powers – twice by Britain, once by France and once by the USA – interested in a potential partnership, but on all four occasions opted for a haughty, dismissive approach, and so no further formal contact was made until Taiping troops appeared outside the gates of Shanghai in 1860. Throughout this interim missionaries, mercenaries and merchants continued to travel up to Nanjing, but we simply never hear of them being approached to establish more formal relations with the foreign powers. Hell, we don't even see much evidence of their being efficiently used! The Taiping aren't known to have, for example, offered to purchase the smugglers' steamers for use against Imperial water forces, or integrated foreign mercenaries into their regular formations as training instructors and officers, or concentrated their imported weaponry in particular formations, or even simply setting up regular channels of communication through the missionaries. Where all the kinks in Qing-Western relations were being ironed out, the Taiping became complacent in their existing arrangements.
Yet Western policy towards the Taiping played a result as well, and it can hardly be considered to have been the result of a few bad eggs. Under the terms of the 1858 Treaty of Tientsin, Nanjing was to become a treaty port open to Western trade. This was despite the fact that Nanjing was at the time still the Taiping capital. I think Platt is perhaps wrong to pinpoint a reversal in British attitudes to the period of 1860-2, as to be frank Western authorities appear to have largely been sceptical of the Taiping from the start. The question should really be more one of Western policy towards the Qing – how they went from broadly hostile to assisting them against a common enemy. The cynical answer would be that issue of trade: the West had just obtained a series of favourable concessions from the Qing in 1858 and 1860, and were not about to give them up in favour of a rebel state that was not bound by the same deals and would likely offer more resistance to invasion. The more generous interpretation would be that the Qing were simply better at projecting an image of stability than the Taiping – the Qing regency was largely competent, the Taiping seemed to have a leadership change every couple of months; the Qing were making progress and the Taiping were in retreat, with the front line on the Yangzte creeping closer and closer to Nanjing by the day. It is perhaps no coincidence that missionary reports from Nanjing took a much more critical turn after the Qing took Anqing in late 1861 (at this stage having already courted Western help by successfully demanding that foreign merchant ships stop selling grain there during the siege) and began to threaten Nanjing proper. As such the Qing appeared to be the winning side and thus the more sensible side to support. And the Qing did much to exploit this image. By appealing simultaneously to the British and French, the Qing were able to encourage competition between the two states, and thus make the most of their contribution to the war effort, enticing each to provide ever more officers, ships and weapons to support the Qing in the hopes that they would receive more favour than their competitor.
Although I do adore Platt's book to death in many ways, I don't think his argument regarding the Western motives for war infallible, though I do agree with his explanation of the process. Whilst I would agree that outright military intervention was the result of the situation on the ground and not some grand strategic vision, it is quite clear that pro-Taiping sentiment among the British officials in China had always been a distinctly minority one, at least among those of significant status (the only vocally pro-Taiping official I know of to have had a major consular role before the war's end, Thomas Taylor Meadows, had completed his term at Shanghai by the time Li Xiucheng had arrived), and that British pretensions of 'neutrality' appear largely to have been in service of their version of the status quo, the definition of which could be warped at will in its favour. On the other hand, although I do not believe that it was just unfortunate coincidence that British officials were predominantly anti-Taiping, I would still agree with Platt that it was mainly through such officials that what had been neutrality became war. Only Frederick Bruce had the authority in 1860 and '62 to order British troops in Shanghai to open fire on the approaching Taiping, in the former case having ignored letters from their commanders that affirmed that Western property was to remain unharmed. Only Admiral James Hope had the means in May 1862 to issue an ultimatum to the Taiping garrison at Ningbo. Whilst British hostility towards the Taiping was never in doubt, it could still only play out through the involvement of those individual agents.
A word on Bibliography:
Essentially all the information I used can in fact be found in Platt's Autumn in the Heavenly Kingdom, but a more complete account of the four diplomatic missions to Nanjing can be found in Jonathan Spence's God's Chinese Son (1996). For missionary reports on the Taiping see eds. Prescott Clarke and J.S. Gregory, Western Reports on the Taiping (1982). Platt's argument about individual consular and military officials appears largely inherited from Gregory's Great Britain and the Taipings (1969), which also argues that it was low-level officials rather than central policy that led to war. Teng Ssu-Yu's The Taiping Rebellion and the Western Powers: A Comprehensive Survey (1971) is somewhat misnamed and actually has little to say that cannot be found in other publications such as Gregory's.