Why some American websites ban foreign IP addresses from accessing them?

It’s kind of a two-way street. There’s plenty of sites that don’t let Americans on. Part of it is due to locational rights to various media or legal precedents that must be considered.

Using a VPN can circumvent these by convincing the site you’re visiting from a different locale.