Elon Musk shared on X that Grok must follow moral rules to avoid misuse, after the chatbot was linked to inappropriate images.