The people of God are not to adopt the practices of worship of the lands they inherit. They are to worship God alone and not entertain other gods. Furthermore, sin among the people must not be ignored, but addressed. God recognized that someone who compromises their worship with the world stands to misdirect others with him. God is also just in that blasphy against God should have a net of witnesses who will lay the charge against him. This was the law that was applied to Jesus as He was being falsely judged for blasphemy.
God's people have the best judge of all and do not need to rely on the world's court system. God gave His law, but also places in position godly men to act as judges in cases that cannot be resolved without the intervention of a third party.
God's appointed rulers are not to live high and adopt worldly living. They are appointed to lead the people and he is to keep God's law close. Before God he is no better than the people he leads. He is to remain humble applying God's laws to hawlf as well as the people of the land. Power has the potential to corrupt good men and God wanted to remind the King to keep proper perspective.
As Christians we are also charged to love differently from the world and be an example to the world of God's power. We cannot entertain ungodly practices and hold ourselves up as people of Gid. Only as we become holy does God get the glory in our lives. We should not reject holiness as unattainable, but seek after it making it part of our practices so that we can be seen differently from the world around us.
May God richly bless you as you seek Him and as you serve Him.