It let them raise enough money to pay for top-tier infrastructure. It also gave them access to stock options, to pay for recruiting a top-tier research and engineering team. I don't think we would have GPT-4 and the OpenAI API if they hadn't turned into a for-profit company.
And honestly, compare what OpenAI has done for AI research to the impact of any nonprofit. What nonprofit has done the most for AI research? Stanford? MIT? I'm not sure what the top AI achievement from any nonprofit is, in the modern era. It's like nonprofits can do a good job of kickstarting a field (AlexNet, early PyTorch), but once enough money and attention goes into it, they have to hand the baton to for-profit companies.