Governments punishing good and bad

Do you ever wonder how a government decides what they will reward or punish?

If there is not an objective foundation from which they draw the laws, how can you ensure that laws created today will still be worthwhile in 100 years or how can we be sure that 100-year-old laws are still valuable today?

Is the "good of the nation" or the "good of the common man" the basis upon which laws should be created? Who determines what “good” is or who the “common man” is?

Maybe the shifting sand of this loose foundation is why virtually every major empire in recorded history seems to have a shelf life of about 250 years at a maximum from the time they ascend to become a great world power.