Notice it was the lying spirit, not God who did it. If God would have caused those prophets to lie, then He would have sinned, as that contradicts James 1:13. But by Him sending a lying spirit to do it, He didn’t cause it Himself. He used it to do the job for Him.
As the 2LBCoF so aptly states it...God hath decreed in himself, from all eternity, by the most wise and holy counsel of his own will, freely and unchangeably, all things, whatsoever comes to pass; yet so as thereby is God neither the author of sin nor hath fellowship with any therein; nor is violence offered to the will of the creature, nor yet is the liberty or contingency of second causes taken away, but rather established; in which appears his wisdom in disposing all things, and power and faithfulness in accomplishing his decree.
( Isaiah 46:10; Ephesians 1:11; Hebrews 6:17; Romans 9:15, 18; James 1:13; 1 John 1:5; Acts 4:27, 28; John 19:11; Numbers 23:19; Ephesians 1:3-5 )