A north London landlord has been ordered by a court to pay £37,000 after 18 people were found living in a terraced house.