Any member of a governing or legislative body of any county, city and county, or city, who, by his vote, violates or attempts to violate any of the provisions of this article is guilty of a misdemeanor and may be punished therefor as provided by law, and may be deprived of his office by the decree of a court of competent jurisdiction, after trial and conviction.