The exchange is not taking the other side of the bet; they're just matching you up with another user who wants to take the opposite position to you and then taking a fee for providing that service.
The problem I you compete with other exchanges and so need to compete on odds or customers go elsewhere. If there is an imbalance in your system because the favored home team has more people on you platform (or someone else has extra of the unfavored team and so has better odds) you take the losing side just to keep the customers and then pay out when you lose.
the above is much less likely if you are national, but there may be small competitors with an advantage live this you are trying to compete with
A restaurant won’t start selling clothes because if they don’t the customers will go elsewhere to buy clothes and they won’t come back.
A stock exchange won’t start holding a book of shares to give “better” prices to customers. What would that even mean? If the price is better for the buyer it will be worse for the seller! (If you mean that they will buy for a high price and sell for a low price to keep all customers happy maybe the customers won’t go anywhere but the “exchange” will go bankrupt.)
Why would a betting exchange be different? Does Betfair for example act like you suggests or is it just something you’re imagining?
In Stocks exchanges and brokers are different things. Exchanges list companies, they are the places where different brokers gather to exchange stocks and agree on prices. Brokers are people/companies who go to the exchange on your behalf (historically someone physically went there, now it is mostly computers)
NYSE and NASDAQ do complete with each other for companies to list on them. (as do other exchanges around the world). When a company is on more than one exchange there are people who make it their job to run "arbitrage" - this is they buy on one and sell on the other anytime the prices are different and this keeps things in check.
It is also valid for betting platform to run arbitrage with their competitors - but various anti-monopoly laws and other such things should(!) get in the way. I don't know what they are doing about this or exactly what the law says. As such I don't know what Betfair is really doing, but I know this is a risk they somehow either take (which if they are national might be low enough), or if they somehow get arbitrage done.
And betting platform is normally both the exchange and the broker. As such they have this risk and need to mitigate it while staying within the law. There are many ways to abuse mitigation that need to be illegal and so it must be hard to mitigate - this doesn't mean impossible.
the above is much less likely if you are national, but there may be small competitors with an advantage live this you are trying to compete with