I thought the trademark is to prevent costumers from accidentally buying “open AI” from some company other than openAI, while thinking they’re buying from openAI.

Yes, that is what a trademark is for, in general. In this case, the court ruled that the term "open AI" is too generic to qualify for that protection exactly because it is a purely descriptive term that could legitimately refer to any "freely available" model in common parlance.