The passages from Jeremiah 31 describe God establishing a new covenant with Israel that will be different than the Sinai covenant. The new covenant will involve God writing his law on their hearts and forgiving their sins so they will all know God personally. It will break the perpetual cycle of the people sinning and God punishing them. God's ultimate purpose is for the people to be holy as he is holy so they can be his people and he can be their God. The new covenant established through Jesus fulfills this by providing what was demanded - holiness and access to God.