What may be appropriate here is the cobra effect:
The cobra effect occurs when an attempted solution to a problem actually makes the problem worse. This is an instance of unintended consequences. The term is used to illustrate the causes of incorrect stimulation in economy and politics. There is also a 2001 book with the same title by German economist Horst Siebert.
The term cobra effect stems from an anecdote set at the time of British rule of colonial India. The British government was concerned about the number of venomous cobra snakes in Delhi. The government therefore offered a bounty for every dead cobra. Initially this was a successful strategy as large numbers of snakes were killed for the reward. Eventually, however, enterprising people began to breed cobras for the income. When the government became aware of this, the reward program was scrapped, causing the cobra breeders to set the now-worthless snakes free. As a result, the wild cobra population further increased. The apparent solution for the problem made the situation even worse.
Slightly related question:
Is there a single word that means “hitting the target but missing the point”?