Saudi Arabia, the birthplace of Islam and home to the religion’s two holiest sites, has long used its religious clout to project its role as a regional leader. Now that same clout has caught the kingdom in a prickly dilemma.

The monarchy’s desire to cultivate a better relationship with the Trump administration than it had with the U.S. under Barack Obama is exposing Saudi Arabia to criticism that it is unwilling to stand up for its Muslim allies, particularly those caught in an executive order that restricts entry to the U.S....