Because that's standard practice for breaking up protests. See: false flag NYPD starting altercations with police at OWS in order to give police justification for violently putting down the protest.
"If it was considered illegal i think the officers should be punished at least to some extent."
I think they should be, too. The judge had some harsh words for the APD, and the charges were reduced to misdemeanors and the sentence (which was originally looking like years in prison) to time served. Though, one of the protesters in this case ended up spending about 2 years in jail because he had a past warrant (he missed his court date for that old warrant in Dallas because he was in jail on a felony charge in Houston, so they punished him for missing that date). He was just released a few weeks ago.
It's also worth mentioning that APD did not reveal their officers had made the devices or suggested their use in the action, and fought to not reveal their involvement in court. The Houston police department, who were prosecuting the case, didn't even know APD was involved in the protest, until a few lucky breaks led to three of the six undercover officers being outed. It is, frankly, miraculous that those seven kids aren't still in jail and shackled with felony convictions. Dumb luck revealed that they'd been setup, and the prosecutors were forced to fold.
But, it's happening every day. This is standard operating procedure when dealing with protesters; and, not just at the national level. And, as far as we can tell, the chain of command on this particular operation went all the way up to the chief of police. It was not rogue cops going beyond their assigned duties to set kids up for felony charges.
Some references, so this doesn't end up being dismissed as a paranoid fantasy (I know it's pretty unbelievable stuff):
More came out later based on open records requests, but my google fu is failing me at the moment. In short, it was actually worse than we knew during the early stages of the trial when these three articles were written.
"Why are Police officers encouraging crime to begin with?"
You tell me.
Why would police officers encourage crime, encourage violence, encourage escalation in tactics, etc.?
Depends on who the "you" here is. Our schools do a mediocre job of teaching those things (especially finances), many families do a great job of it, and many families do a poor job of it.
But they break user experience with absolutely horrible visual design and to me at least that has been a big turn off. It's like they don't even want new people to start using their stuff.
"California's "eraser button" law will require this policy for all websites with users in the state."
All websites hosted in California, maybe. Would they decide to restrict access to sites that don't comply? The easiest way to comply would be to disallow Californian minors. The kids would just change their age or state.