Then why are there the Ten Commandments. ?
They are there to teach us how sinful we are. The Ten Commandments don't save anyone. They aren't the way to heaven. Why? Because no one can keep them. The Bible is clear on that.
James 2:10
So if we are saved by the grace of God and the death/resurrection of Christ alone, why are there 10 commandments?
They are there to expose our sin. To remind us that we CANNOT behave, CANNOT be perfect, CANNOT earn our way to heaven. We should try to be moral and try to obey them because it's the standard of God's holiness. But they are impossible to keep perfectly.
Read the story in
Matthew 19 of the young man who came to Jesus and wanted to have "eternal life". He wanted to know what to "do". Jesus knew what was in his heart - a "to-do" list of behaviors to get him into heaven. He wanted to know how to EARN his way into heaven. So Jesus started with the 10 Commandments.
The young man claimed he had kept them all. That was a blanket
lie. Ergo, he had NOT kept them. But he thought himself pure and Godly.
So Jesus goes into other behaviors. He begins with self-centeredness and asked the young man to go and sell all he has and to follow him.
The young man was too attached to his wealth in a greedy way and walked away from Jesus, saddened.
He found out he was not "good enough" to follow Christ. But he never learned that no one is!! Hence, the need for grace!!! We may sincerely desire to obey ALL TEN of the commandments, but it is sincerely impossible.
The purpose of the 10 Commandments is to expose our sinfulness and need for Christ.