A man who formerly worked as a lieutenant in the food service section of the state’s prison for women will spend the weekend behind bars, after he pleaded guilty Wednesday to a sex offense involving an inmate.