If I remember correctly, according to the immigration laws state he is here illegally. Since he is here illegally, he is in violation of the Massachusetts criminal trespass law. All the sheriff is doing is enforcing state law, not the federal immigration law. Also, the state attorney has already reviewed this specific application of the law, and indicated thew sheriff is applying it correctly.
It's a New Hampshire case, but if Massachusetts has a similar law then let's nail this crimalien on both counts and ship his butt back to his home country.