What's the use of the universe if Earth is the only habitable planet?

First, we don’t know Earth is the only habitable planet. However, until we have some proof, we have no way of knowing for sure. That’s why we’re searching so hard for extraterrestrial organisms.
Second, who says the universe has to have a use? It just is. Similarly, you could say what’s the use of living if you die in the end. That kind of view doesn’t do anyone any good. Just go with it and enjoy the exploration and discovery life offers us, like whether or not life exists elsewhere in the Universe.