Religious moral teachings can be restrictive, but it's not the main problem. People who are raised in religious families may have difficulty exploring their sexuality due to many different reasons. It could be because they were taught that sex is sinful or wrong and thus avoiding it altogether. It can also be because they were told that sex is only for procreation and nothing else. This makes them feel guilty about sexual thoughts and desires. Some religions don't talk openly about sex, leaving people confused and ashamed. They might even fear being judged for having sexual feelings. In addition to this, some people struggle with trauma from childhood abuse or assault. All these factors contribute to limiting one's self-exploration in bed.
Religious moral certainty limits sexual self-exploration by creating anxiety and shame around the subject. The person feels like what they want is wrong, and so they repress their desires rather than explore them. They may believe they need to find someone to marry instead of focusing on discovering themselves as an individual. This can lead to problems later on when married life doesn't meet their expectations since they haven't taken time to figure out what works best for them.
If a man was never able to masturbate before marriage, he may have trouble finding satisfaction in his partner since his body isn't used to getting off through other means.
Another reason religion limits sexual self-exploration is that it creates boundaries around behavior outside of marriage. Many religions teach that anything outside of monogamy is immoral and should not happen.
Many people are naturally polyamorous or non-monogamous but can't act on those desires due to cultural stigma. Even within a marriage, some people may desire kinkier sex acts that go against religious beliefs. Religious beliefs also create restrictions on gender roles, making some activities taboo between partners. As a result, people don't learn how to communicate about their needs and wants openly because of fear of being judged negatively.
The solution is for people who come from a conservative religious background to get educated about healthy relationships and positive sexuality practices. It takes effort to undo years of conditioning, but it's possible with enough exposure to different perspectives. They might attend workshops or read books on the topic to understand alternative viewpoints. They could also seek counseling from professionals experienced in helping people overcome trauma related to sex. The more someone learns about themselves and their desires, the easier it becomes to find compatible partners and explore new things together.