New American Standard Bible 1995
21 My son, fear the Lord and the king; Do not associate with those who are given to change,
New King James Version
21 My son, fear the Lord and the king; Do not associate with those given to change;
English Standard Version
21 My son, fear the Lord and the king, and do not join with those who do otherwise,
24:21 The Westminster Leningrad Codex
21 יְרָֽא־אֶת־יְהוָ֣ה בְּנִ֣י וָמֶ֑לֶךְ עִם־שׁ֝וֹנִ֗ים אַל־תִּתְעָרָֽב׃
IMHO, since said verse uses "the" article for the "Lord" and then another "the" article for the "king", it is trying to emphasize that:
a) the Heavenly Divine God is "Lord"
b) and the earthly governing leadership represented by the term "king"
are 2 separate entities.
In the Proverbs 24:21a part of the verse, I can understand when it emphasizes that we should fear the Heavenly Divine God , however, it then continues on to emphasize that we should fear the earthly governing leadership.
The problem is that earthly governing leadership may or may Not be aligning themselves with being Godly. For example, King Ahab of the Northern Israelite kingdom was evil.
How should the bible reader properly interpret and apply Proverbs 24:21a use of the term "the king" if the earthly governing leadership happens to be evil?
Update: ( Good insight from @agarza 's answer ) +1 for @agarza "So in Proverbs, Matthew, and Romans, the "fear" is more akin to showing respect for their authority. Nowhere in these three passages is the direction to give unwavering fealty, just respect."