This is the issue in Romans 13. If governments do evil (and they often do), are we commanded to obey and follow them by doing evil ourselves?
Absolutely not. Let me give you some examples.
Remember the midwives in Exodus 1 who were supposed to commit abortions on the Hebrew babies, but they refused? They even lied about it, but it says God blessed them for it.
What about Daniel, who was commanded by the edict not to pray (Daniel 6)? What did he do? He disobeyed the governing authority.
Or what about earlier in Daniel 3 when the king commanded the Hebrews to bow to an image? What did they do? They refused and were thrown into the fiery furnace.
They disobeyed an evil order from the government. This shows us that there is sanctified civil disobedience in the Bible.
Another example is that of the Maccabees who lived in the 2nd century BC. They defied the foreign king Antiochus Epiphanes and even violently rebelled, overthrew his rule over them, and even killed many unfaithful Jews in the process. The Maccabees regained their country and restored the true worship of God. I believe these Jewish fighters were prophesied of in Daniel 11:32 as "the people who know their God shall be strong and carry out great exploits." Those incredible events led to the feast of lights (also called Feast of Dedication or Hanukkah in Hebrew) which Jesus celebrated in John 10.
In the New Testament, the religious authority commanded Peter and John to stop preaching about Jesus (Acts 4). They refused to obey, saying, "you judge whether it's right to obey God or man."