Organized religion helps keep you accountable, so you don't just change your beliefs in response to your wants. Everyone's susceptible to cognitive dissonance without a concrete root.
The trick is to not follow legalistic religion*. You don't become moral by following rules, you follow rules because you're moral.
*This comment is not directed at Islam in particular. I don't know enough about them to say whether they're legalistic in general.