The blame here must reside with the justice system. There will always be companies attacking their competitors by legal means, it must be the responsibility of the system to not let them get away with it.
Indeed, the situation reeks of a rubber-stamp mentality among the court staff involved with this case. Having worked in law enforcement in the past, I've seen first hand how some judges can just blindly approve whatever warrant or order comes across their desk without so much as a cursory glance at the details, consequences be damned.
The blame here must reside with the justice system. There will always be companies attacking their competitors by legal means, it must be the responsibility of the system to not let them get away with it.