The basis is that God ordained it. The Books of the Law prescribe specific earthly punishments for earthly crimes as well as establishing the fact that these are sins that carry eternal consequences.
The idea of an earthly government, which executes judgement is established in several parts of the Books of the Law, but an interesting, specific set of guidelines for an organized government is given in Exodus 18:
1Now Jethro, the priest of Midian, Moses’ father-in-law, heard of
all that God had done for Moses and for Israel His people, how the
LORD had brought Israel out of Egypt.2Jethro, Moses’ father-in-law,
took Moses’ wife Zipporah, after he had sent her away,3and her two
sons, of whom one was named Gershom, for Moses said, “I have been a
sojourner in a foreign land.”4The other was named Eliezer, for he
said, “The God of my father was my help, and delivered me from the
sword of Pharaoh.”
5Then Jethro, Moses’ father-in-law, came with his sons and his wife to Moses in the wilderness where he was camped, at the mount of
God.6He sent word to Moses, “I, your father-in-law Jethro, am coming
to you with your wife and her two sons with her.”7Then Moses went out
to meet his father-in-law, and he bowed down and kissed him; and they
asked each other of their welfare and went into the tent.8Moses told
his father-in-law all that the LORD had done to Pharaoh and to the
Egyptians for Israel’s sake, all the hardship that had befallen them
on the journey, and how the LORD had delivered them.9Jethro rejoiced
over all the goodness which the LORD had done to Israel, in delivering
them from the hand of the Egyptians.10So Jethro said, “Blessed be the
LORD who delivered you from the hand of the Egyptians and from the
hand of Pharaoh, and who delivered the people from under the hand of
the Egyptians.11“Now I know that the LORD is greater than all the
gods; indeed, it was proven when they dealt proudly against the
people.”12Then Jethro, Moses’ father-in-law, took a burnt offering and
sacrifices for God, and Aaron came with all the elders of Israel to
eat a meal with Moses’ father-in-law before God.
13It came about the next day that Moses sat to judge the people, and the people stood about Moses from the morning until the
evening.14Now when Moses’ father-in-law saw all that he was doing for
the people, he said, “What is this thing that you are doing for the
people? Why do you alone sit as judge and all the people stand about
you from morning until evening?”15Moses said to his father-in-law,
“Because the people come to me to inquire of God.16“When they have a
dispute, it comes to me, and I judge between a man and his neighbor
and make known the statutes of God and His laws.”
Jethro Counsels Moses
17Moses’ father-in-law said to him, “The thing that you are doing is not good.18“You will surely wear out, both yourself and these
people who are with you, for the task is too heavy for you; you cannot
do it alone.19“Now listen to me: I will give you counsel, and God be
with you. You be the people’s representative before God, and you bring
the disputes to God,20then teach them the statutes and the laws, and
make known to them the way in which they are to walk and the work they
are to do.21“Furthermore, you shall select out of all the people able
men who fear God, men of truth, those who hate dishonest gain; and you
shall place these over them as leaders of thousands, of hundreds, of
fifties and of tens.22“Let them judge the people at all times; and let
it be that every major dispute they will bring to you, but every minor
dispute they themselves will judge. So it will be easier for you, and
they will bear the burden with you.23“If you do this thing and God so
commands you, then you will be able to endure, and all these people
also will go to their place in peace.”
24So Moses listened to his father-in-law and did all that he had said.25Moses chose able men out of all Israel and made them heads over
the people, leaders of thousands, of hundreds, of fifties and of
tens.26They judged the people at all times; the difficult dispute they
would bring to Moses, but every minor dispute they themselves would
judge.27Then Moses bade his father-in-law farewell, and he went his
way into his own land.
There is simply no reason to assume that Christ's offer of forgiveness from sin in the eternal has anything to do with doing away with earthly consequences for sin.
Added to that, the fact remains that for the most part, earthly punishment for crimes is a matter of civilian government, not the Church. (Yes, there are exceptions, and we'll leave arguing about those exceptions, such as some of the inquisitions, for another forum/question).
As for why governments have authority from a Christian perspective, you need not look any further than Romans 13:1:
Romans 13:1:
*King James Bible (Cambridge Ed.)* Let every soul be subject unto the higher powers. For there is no power but of God: the powers that
be are ordained of God.
Related:
Beyond this is the fact that fear of punishment is a deterrent. If you've ever seen mob mentality, or riots that occur when government authority breaks down, you can see that authority is in and of itself, good, and necessary for maintaining order and safety for the "good" citizenry.