Cameron was trying to save the Tory party from the Nigel Farage white supremacist movement. It gave the Conservatives another 8 years in power.
But it was the UK voting population that voted for Brexit, not any political party, not any MPs. The MPs and political parties all wanted to stay and take their turns at the gigantic feeding trough which is the EU.