STR are probably enforced from neighbor complaint. In the newer HOA communities, HOA tends to enforce it as it clearly states no STR.
How would I fix the problem? It would include changes to how one can obtain citizenship. I don't think that one should be able to "buy" their way to citizenship. Once no one can buy their way to citizenship, ban foreign ownership of US real estate. Only US Citizens can buy US real estate. In addition, there could also be something along the lines of buyers not being able to compete against FTHB besides FTHB. Meaning once an offer for a FTHB is submitted, only FTHB(s) can compete with each other for the home. Investors competing with FTHB(s) is quite ridiculous and unfair. Taxing is another alternative but no matter how much you tax, the homes are always going to be significantly cheaper here in the states compared to China.
Keep in mind just because the US is a capitalist economy, it doesn't mean we can't have laws for checks and balances. The recent ruling regarding buyers commissions is a good example of that and it will be interesting to see what happens with buyers agent commissions going forward.