You're forgetting a lot of downsides of the U.S. system, and the fact that individual states do have referendums, and you're oversimplifying the UK system.
David Cameron wasn't ousted, he pushed hard for a specific outcome in the referendum, and he lost. The voters rejected a deal he had negotiated, and a policy he willingly bet his premiership on. All that said, he could have stayed as long as the Conservative party wanted him, but it's reasonable for him to step down after losing.
The vote itself also wasn't binding, it's up to Parliament to execute it. This wasn't a law that was passed by referendum. Unlike in the U.S., Parliament (technically the "Queen in Parliament") is supreme in the UK, and can change any law it wants. There's no written constitution, and thus not really the concept of an "unconstitutional" law. The PM is elected by a majority of parliament. This system means that a government usually can get its manifesto legislation passed, and it's easier to hold a government responsible for keeping its promises. The U.S. system can allow for years of deadlock, and whereas an independent commission is responsible for defining constituency boundaries in the UK, they're set by politicians in the U.S. If a party can gain control of the legislature of a state (quick - name any member of your state legislature), it can effectively control that state's seats in Congress for a decade. All of this lends a lot more legitimacy to the UK government.
So yes, getting things done in the U.S. system is harder, and it's easier for a few states to block legislation. That doesn't mean the U.S. system has greater legitimacy, quite the opposite. The state governments are barely accountable for their actions, and even a party with strong popular support can fail to get its legislation passed thanks to the byzantine electoral system.