In the U.S., is it legal to prohibit your tenants from posting outside signs in the rental agreement? E.g. election signs, flags etc. Or would that be a violation of their right if they are renting from you.
Yes, this can be limited. Private property owners can and do prohibit certain uses of their property so long as it doesn't infringe on the use of "basic necessities" that all units must contain (access to bathroom and kitchen). They most certainly possess the right to delimit certain uses of the property. They don't even have to allow any use of common areas if they don't want to.
A lease, or a rental agreement is a contract like any other; a bargained for exchange. So long as the agreement fits within the parameters of jurisdictional housing laws, anything can be bargained for. I have never seen a local fair housing law that included the right to display signs. Especially political ones.
A public housing complex almost necessarily has to ban it, or they would have to allow everybody to put them up since public monies disallow discrimination.
Most leases/rental agreements don't list every single thing that is not allowed in writing, because the bounds of what the human mind can fathom are endless. That said, there is typically a clause(s) that gives the owner/property manager the right to disallow any activity that could give rise to general disputes, could reflect poorly on the owner, or may in any other way be disruptive to the peaceful enjoyment of the property. With this clause, there is typically wide berth as far as what types of limitations can be imposed, with a termination clause allowing the owner to end the lease or the tenant to back out if they cannot agree on the specific action or behavior.
With local Election Day fast approaching, my neighborhood is absolutely littered with signs in every lawn supporting someone or other. This certainly creates a perception of that property owner based on who they're supporting politically. Imagine a small dwelling (a couple of units), all with opposing support being announced through their signs (if allowed) and how that may create tension amongst neighbors (people can get excited over politics) who see each other regularly.
Worse: Imagine a large complex. If allowed, there could be so many signs that there'd be no lawn left for quiet enjoyment!
It would appear that it is legal to make such prohibitions as a condition of their lease. The first amendment prevents government from interfering with your right to speech; it does not prevent you agreeing to refrain from exercising it in a contract. Presumably, someone who feels strongly enough about this will rent somewhere else or otherwise negotiate it out of the lease.
Although cities and other government entities are constrained by the First Amendment in regulating political yard signs, there is no similar restraint imposed on private homeowner and condominium associations. Seemingly the only free-speech avenue for a resident in a private homeowner association is an argument based on an individual state constitution.
However, they can fall foul of state law, see the link for details.