Originally, a landlord had no duty to present the rental in a habitable condition, or to make any repairs to keep it in a habitable condition. The only obligations the landlord had were the terms and conditions in the lease contract. This is still true of commercial tenancies, but in residential tenancies a warranty of habitability is implied as a matter of law.
The seminal court case is Javins v First National Realty Corp decided in 1970. The District of Columbia Circuit Court of Appeals held that a warranty of habitability is implied in residential leases, and breach of the warranty of habitability is a defense in an eviction.
The Court reasoned that local housing codes require a warranty to be implied. The Court also noted that society had changed since the old common law rules first evolved.
In agrarian England and early America where these rules first developed, the primary purpose of a lease was use of the land for agriculture. If a peasant erected a thatched hut on the land, that was secondary to agrarian purposes. In modern life, a residential tenant seeks a habitable dwelling, not land to farm.
The Court also noted that the modern trend was to treat a lease as contract as well as a conveyance of land. The Court pointed to implied warranties in other consumer contracts, such as sales contracts.
The Javins Court found that landlords and tenants in urban housing markets have unequal bargaining power, preventing tenants from bargaining for an express covenant of habitability.
After the Javins decision, states began adopting an implied warranty of habitability through court decisions and/or legislation. Now in the US a warranty of habitability rule is essentially universal. The standards the landlord must meet to satisfy the implied warranty, and the remedies available to the tenant upon breach of the implied warranty vary among the different states.
If you have questions about the implied warranty of habitability, you should contact a lawyer in your jurisdiction.