A pastor friend of mine, Joby Martin, recently told the story of taking his daughter to a birthday party. It was at one of those trampoline-filled warehouses, probably called “We Hate Kids but We Love Broken Bones.” Sure enough, Joby’s daughter felt her arm pop halfway through the fun. So he took her to get an X-ray. Diagnosis: trampoline-induced fractured elbow.

An X-ray machine is helpful, you see, but it’s got limits. It does a great job revealing the problem, but X-rays are powerless to do anything to fix it.

In the same way, the law is like an X-ray that shows us how spiritually broken our heart is, but it is powerless to fix it. Many of us try to use the law to fix our busted hearts. We might as well try using an X-ray to fix a broken bone.

The purpose of the law is not primarily to correct sin, but to reveal sin.

As the Apostle Paul puts it, “No one will be justified in his sight by the works of the law, because the knowledge of sin comes through the law” (Romans 3:20 CSB).

The law was supposed to function like a mirror that reveals to us how sinful we are. By looking into it, we see the shape of what our heart should be—and what it isn’t.

Take, for instance, commandment 7, “Do not commit adultery.” This shows me that I’m supposed to love purity so much that any sexual desire I have for someone besides my spouse is outweighed by my love of purity, my love of God’s design.

Or commandment 9, “Do not lie.” This shows me that I should love honesty so much that I’m never tempted to lie, even when doing so would gain me some advantage.

Commandment 10, “Do not covet,” shows me that I’m supposed to be so satisfied with God and so trusting of his plan for me that I don’t get jealous when someone else has something I want.

But I read these commandments (along with the other seven) and think, “My heart is not like that!”

That’s what Paul means when he says, “Knowledge of sin comes through the law.” The law shows me how messed up and spiritually rotten my heart is.

Yours, too.

Simply forcing yourself to act righteously isn’t going to change your heart. If anything, it just covers up the corruption. It’s like finding an old piece of leftover chicken in your fridge. And I mean old. I’m talking, you-take-a-whiff-and-wake-up-four-hours-later old.

When you find a piece of chicken like that in your fridge, you could say, “You know, the problem is it just doesn’t have enough spice. A little barbecue sauce should take care of that. Good! Now I can’t smell the rotting meat anymore!” You could say that, but you probably wouldn’t. You know well enough that covering rottenness doesn’t remove it.

We aren’t quite so wise when it comes to our hearts, though. The law, you see, sweetens up our behavior without changing our hearts. But God wants us to be so naturally righteous in our hearts that we wouldn’t need a law to do what is right. We’d instinctively do it.

I don’t need a law to do the things I love. You never have to command me to eat dessert. Or take a nap. Or kiss my wife. I love to do those things—no law required. The law is only required where my heart wants to go the wrong direction.

Growing up, my grandad used to raise pigs, and sometimes he’d take me with him to feed them. The slop these pigs ate was the nastiest stuff you could imagine. It was basically just rotting food from the trash can. Revolting.

The pigs, of course, loved the stuff. But not one time did my grandfather ever have to say to me, “Now, J.D., I’m going to put this slop down and go grab something, but don’t you eat it. If you do, you’ll be punished.” I could sit there beside it for an hour without a hint of desire to touch it. Even if grandad had given me permission to scoop out a handful and eat it, I wouldn’t have.

If the pigs, however, had a clear path to it, they were going to devour it like it was their last meal. If you wanted to keep them from the slop, you had to restrain them.

This is a parable, of sorts. You and I are the pigs. The law is the fence. It can keep us from the slop of sin, but deep down, we still want to eat it. And that’s the problem.

God doesn’t want spiritual pigs in heaven—people who want to sin but only act righteously because they are afraid of punishment. He wants people in heaven with his heart, who wouldn’t choose sin even if they had the opportunity.

He’s not just after obedience. He’s after a whole new kind of obedience.