Section 22. Male and female prisoners shall not be put or kept in the same room in a jail or house of correction; nor, unless the crowded state of the institution so requires, shall any two prisoners, other than debtors, be allowed to occupy the same room, except for work. Persons committed for debt shall be kept separate from convicts and from persons who are confined upon a charge of an infamous crime. Conversation between prisoners in different apartments shall be prevented. Minors shall be kept separate from notorious offenders and from persons convicted of an infamous crime. Persons committed on charge of crime shall not be confined with convicts, and prisoners charged with or convicted of a crime not infamous shall not be confined with those charged with or convicted of an infamous crime, except while at labor or assembled for moral or religious instruction, at which time no communication shall be allowed between prisoners of different classes.