Maybe they realised it was a superior solution to building their own app.
Not directly related to mattermost and Uber, but companies tend to list clients even if the product is not widely used or was even dumped.
You are a small team in a big company, you evaluate a product and find that it satisfies some of your basic needs but want to work with it for a while, so you purchase a couple of licenses for you team but stop using it after a year or two.
voilà ! you are a client listed on their web site
Uber's internal chat tool is built on top of Mattermost.
But even if they didn't, it's not as simple either as "can those engineers clone this software for less than X", it's whether they can afford to take the opportunity cost of not having engineers work on something core to Uber's business.
Anyway, as another commenter pointed out, on an enterprise scale I'm sure you can get a good deal. I can also imagine however that at that scale you'll want multiple Slack servers / instances - which would add cost given how slack charges per person, per server.
So there's a few alternatives then; self-hosted (some parties will offer enterprise customers the option to host an instance of their application on the customers' internal hardware), or rebuild it yourself. The latter one however takes a bit of math - how much is it going to cost to build, maintain and run it? It's easily underestimated.
And yet, it's also easy for people working in an engineering culture with nearly limitless engineering capacity to just build it themselves - motivations being "how hard can it be", and "I need something more challenging than tweaking this button for my employer to earn 0.1% more money on this particular feature". I've seen it happen far too often.
Given that Slack can be seen as IRC with some pretty decoration glued up to an Elasticsearch instance, and that Uber already has a highly trained tech org in place, if it wants to make a Slack "clone" for less than, say, $25million (cost of Slack to Uber for 5 years), it could actually be a pretty sensible decision- especially when you take into account the tax and stock-price benefits of capital expenditure.