The law is given to the wicked who are unable to live according to love. They need the law because they are wicked and it uses threats of punishment to create the illusion of love in people that don’t have it. If you obey the law, because it is the law, then you can’t get to heaven. Even Jesus had to break the law to be loving when he refused to sustain the law in killing the harlot caught in the act and other instances. Once we come to Christ, truly come to him, second comforter, then we are no longer under the law and it is taken away.
The Children of Israel didn’t start out with the law, it was added because of transgression.