Yes, God gave them- through the nations that He sent to conquer Israel.No... that passage doesn't say that it was laws of other nations. God says I GAVE them.
Find some scripture that breaks the laws out into "good laws" and "bad laws". It doesn't exist. Read Psalm 119. David embraces the law. All of it.