Section 24. In any statement of births or deaths printed by a town the name of a child born out of wedlock or of its parents shall not be printed, but the words “child born out of wedlock” shall be used in place thereof. A town violating this section shall forfeit to the mother of such child not more than one hundred dollars.