I don’t know of specific cases, but same-sex marriage is legal in all 50 states, so there would not be any issues there with local religious politics, as US consulates operate under US law.
The name on the visa would need to match the name on the passport it is placed in.
Maybe others with more knowledge of Morocco can speak to this, but it might be better to look at getting married outside of Morocco or via Utah online, and pursuing a spousal visa.