It surprises me that the government would take such a clearly moral stance...I suppose I'm too cynical, but I can't help but wonder if they had an ulterior motive?
And, as an AH scenario, what if they hadn't?
You are cynical. As noted, public pressure. Nobody wants to be votes out. But in that case one could argue that everything an elected government is for the ulterior motive of being re-elected.
The slave-trade did not favour Britain's rivals, and as noted by Susano, the Sultan of Sumgodforsakenswampineestafrika was not a rival to British power and so we had no need to spend valuable time and resources making him stop slaving.
The Dean, I'm not sure I understand you. You're saying we felt bad about having been engaged in the despicable traffic in human misery, so we decided to make an effort to show that we'd reformed by trying to destroy it, and you consider this an "ulterior motive"?
You must be bad at taking apologies.
In conclusion, the British people turned against the slave trade, just as everyone was starting too at the time, and the government went along with that, also having their own moral convictions (Wellington, for example, got the trade condemned at Vienna at some diplomatic cost, and if Vienna had been all about pleasing Britain's bleeding-hearted public opinion, why no free Poland?). That's not to say we and the other European powers were happy-shiny-fun in the 19th century, but we were capable of pursuing moral causes.
On a related topic, the actual abolition of slavery itself, certainly there's no motive to be found there. We shot the West Indies right in the economic foot, and since we were about the first Great Power to abolish slavery it wasn't like we were under any pressure except our own.