It actually had vanishingly little to do with opium; even if they had laws against its use, the Taiping didn't enforce them, and they bought just as much opium as the Imperials. The actual opium dealers didn't care either way. Much more important was the collapse of the China-Britain-America trade kicked off by the U.S. Civil War; unable to sell american cotton in China or Chinese tea in the U.S. south, the British had to stabilize the situation in one of their markets, and they pick to intervene in China for a variety of reasons. The people who wrote the most vicious reports about the Taiping usually did so on the basis of them being blasphemers, there was fear of a total collapse of order in China (which would make it Britain's 'moral duty' to colonize the entire empire), and there's a total failure of communications.