A rogue landlord who squeezed six people into one room of his HMO has been told to pay £37,000 in fines and costs.