"I have never been able to resolve how a bad person can get salvation and go to Heaven while a good, religous person who does not get salvation is denied heaven. At least by those that believe the literal word of the "bible"."
A "bad" person who recognizes in his heart, that he is a sinner, (as we all are) and who repents and accepts Jesus as his Lord and Savior will be saved.
It's what is in your heart. I can be a "religious" person, show up for church every Sunday, put money in the collection plate, and look and act "religous", but that won't get me to Heaven. Epesians 2:8-9 "For it is by grace you have been saved, through faithand this not from yourselves, it is the gift of God 9 not by works, so that no one can boast."
Good works don't get you to Heaven, we are saved through faith in Jesus and no one else. If we could save ourselves by doing good works, then Jesus died for nothing. But thats not correct, Jesus paid the price for all sins of those who believe in HIM.
Luther added the word "alone" and challenged anyone to go against him. Faith "alone" is not true to the original texts.