This censorship mechanism comes from 2011, when it was created under the Spanish Socialist Party's government lead by Zapatero. There was a lot of backlash, but the Intellectual Property Comission (also known as "Comisión Sinde") was never dissolved under the next governments' rules.
Re: La Liga's censorship, it isn't promoted by the government but by La Liga itself with the collaboration of the largest ISP, Telefónica/Movistar. Movistar used one of the subsidiaries to denounce themselves and other IPs so they would reach a friendly agreement (again, with themselves) that the judge considered enough to enforce the current Cloudflare blocks.