The gospel reading (Mt. 22:1-14) for the 28th Sunday in Ordinary Time provides an example of what may be meant by this saying: "Religion is for people who don't want to go to hell. Spirituality is for people who have been there and don't want to go back." While this saying overlooks some of the positive aspects of religion, it's point is made clear by the parable of the Wedding Banquet. In the parable a king prepares a wedding banquet for his son. Several of the invited guests are too busy with other things to come; others greet his messengers with hostility. Frustrated, the king sends his servants into the streets to invite anyone who will come. The street people, all except one, are grateful to be rescued and come in wedding clothes. The one who did not bother to dress is shown the door.
The parable sheds light on the religious people who are busy, satisfied with their lives - after all they are not living on the street - and see no need to accept the king's invitation. The street people, on the other hand, are living in a metaphorical hell. (In biblical times the life of street people was a special kind of hell.) When rescued by an invitation they respond with gratitude. That expression of gratitude and show of respect to the king by wearing wedding clothes can keep them from going back to the hell from which they came.
This saying emphasizes a point: Sincerity of heart (spirituality) trumps self-satisfied respectability (religion.) It, however, overlooks the positive value of religion. It has institutionalized teachings and practices that can serve as guides for the sincere of heart. One can have a deeply sincere heart and be self-deceived as to what is truly good. Religion can serve as a guard against self-deception.
Institutionalized religion also has downside. It puts fallible humans in positions of power, making it all to easy for them to become self centered and corrupt. This is a danger for all of us sitting in the banquet hall. Enjoying the grace-filled gifts of the King, we can forget that we were rescued and turn our backs on the king's ongoing invitation.