A judge has ruled against Elon Musk's latest attempt to stop OpenAI from transforming into a for-profit organization.