What does that have to do with laws against encouraging illegals to live here?. Are you saying free speech means it was ok of obama to give illegals a card promising them they will not be prosecuted for breaking immigration laws???
Giving a card is not speech. "Encourage" can include verbal encouragement. The federal appellate court ruled it violated 1st Amendment rights.
Again, that law applies to individuals, not governmental entities.
They can't be promised they won't be prosecuted for violating immigration laws. The city/state cannot prosecute immigration laws nor can they prohibit federal authorities enforcing those laws.
Enforcing immigration laws does not seem to help the problem. Many of them have been deported several times and returned. They need to be prosecuted and imprisoned for the crimes they commit--not deported.