You should absolutely get your diet under control and build a consistent exercise routine in the long run. But both of those things will be very hard to do without the proper dose of high quality sleep every night. Without proper sleep you'll be fighting your own body every step of the way. Every positive health outcome gets harder to achieve without sleep, not easier.
For most people, making major, permanent lifestyle changes is much harder than using a CPAP machine. For people with chronically disrupted sleep, that gap is even wider.
Healthy diet and exercise are free in principle, but you have to choose extremely cheap options for them to actually be cheaper than a CPAP machine in practice.
It's not really "better for" someone with OSA because lifestyle changes alone only have a small effect on OSA severity. It's like going on a low-sodium diet when you have hypertension: it's not a bad idea, and it's almost always good for a few points of improvement, but only an utterly incompetent doctor would recommend it as the sole treatment.
Although, I wonder _if_ the false dichotomy were entertained, what will contribute to quantity and quality of life more.