As an initial matter, a lease is not an ordinary contract. In fact, historically a lease was not viewed as a contract at all, but rather as a conveyance of a property interest, namely a leasehold estate. This is why the common law rule is that a landlord is not under any obligation to mitigate damages relative to a tenancy: the duty to mitigate damages is part of contract law, not property law. However, most US states no longer adhere to the common law view of a lease as being purely a conveyance, and instead, they view a lease as both a conveyance and a contract. See, e.g., Schneiker v. Gordon, 732 P2d 603, 608 (CO Sup Ct 1987) ("Colorado law in this area, though once exclusively rooted in property law principles, has gradually come to recognize that contract principles can sometimes play a role in resolving landlord-tenant disputes.").
In order for the purchaser of a property to enforce a covenant in a lease -- such as a covenant to refrain from moving in new residents -- it has to be established that the covenant in question "runs with the land" rather than being a mere "personal covenant", the latter of which is only binding between the parties to the actual contract (i.e. not the subsequent purchaser). In Colorado, a covenant runs with the land if (1) there is an intent by the parties for the covenant to run with the land (such as a provision stating that the covenant is binding on successors of the parties), and (2) the covenant "must closely relate to the land, its use, or its enjoyment". Cloud v. Association of Owners, 857 P2d 435, 440 (CO 2nd Ct App 1992). The right of the landlord to receive rent is a covenant that runs with the land. DR/CR FAMILY, LLLP v. Burger, 80 P3d 948, 952 (CO 5th App Ct 2003) (citing White v. Short, 794 P2d 1110, 1112 (CO 3rd App Ct 1990)). There does not appear to be any Colorado case addressing the precise question of whether a covenant to refrain from moving additional people into the unit runs with the land so as to be enforceable by purchasers of the property.
(I discuss Colorado law because the OP's name suggests he is in Colorado.)