Anyone who expresses a more definitive response to the question is claiming access to knowledge not based on empirical foundations. This remarkably persistent way of thinking, common to most religions and some branches of philosophy, has failed badly in past efforts to understand, and thereby predict the operations of the universe and our place within it.
To assert that the universe has a purpose implies the universe has intent. And intent implies a desired outcome. But who would do the desiring? And what would a desired outcome be? That carbon-based life is inevitable? Or that sentient primates are life's neurological pinnacle? Are answers to these questions even possible without expressing a profound bias of human sentiment? Of course humans were not around to ask these questions for 99.9999% of cosmic history. So if the purpose of the universe was to create humans then the cosmos was embarrassingly inefficient about it.