Mainly a public opinion issue, really. Policies can't be dictated by cold logic if you have to worry about what your electorate thinks of you. The majority of Britons by the 1820s thought of slavery as something distasteful, something that might be tolerated if extant in place, but that really should be stopped and that Christian white people had no business engaging in, certainly not furthering. A governm,ent going against this senmtiment would face an electoral challenge. Even with all the iniquities of the old system, that mattered - in fact in an age where most votes were controlled by a small circle of educated, wealthy and connected people, it might have mattered more. It was the golden age of political rhetoric, after all. You can't make a good case for slavery on the basis of 19th century Liberalism.
Neither was slavery the only thing British governments invested heavily in suppressing without an immediate gain. Sati, human sacrifice, polygamous marriage, public nudity, and - after 1918 - recreational drug use (other than alcohol and nicotine) were all objectionable to them on moral grounds. The battle against slavery was more expensive, but not fundamentally different.
Of course, there actually was something to be gained in the end. British ships on antislavery patrol secured the coastal waters for British interests.THe treaties and informal arrangements made were instrumental in ensuring Britain got the best parts of African coastline, in the end. Interventions against slave traders drove the acquisition of land and power in the interior, and could cover up a multitude of other motivations. Just like countries today are happy to cry 'Islamist terrorist' in aggressive pursuit of their policy goals, 'slaver' could justify all kinds of violence to the public. But this was an outcome of the policy, not its foundation. The basis lay firmly with public opinion.