Whoever, through invitation or device, prevails upon any person to visit any room, building, or other places kept for the purpose of illegal gambling or prostitution, is guilty of a misdemeanor, and, upon conviction thereof, shall be confined in the county jail not exceeding six months, or fined not exceeding five hundred dollars ($500), or be punished by both that fine and imprisonment.