Berkeley, Calif., looks to become the nation’s first city to take aim at companies supporting Trump administration immigration policies. And other municipalities in the San Francisco Bay Area may follow suit.

That means companies like IBM Inc., Palantir Technologies Inc., and LexisNexis could see an impact on their contract work with some Bay Area cities.

Berkeley is considering stopping work with contractors that help federal immigration officials create databases and registries to target immigrants and religious minorities. The city...