Philadelphia is the first major U.S. city to ban cashless stores, placing it at the forefront of a debate that pits retail innovation against lawmakers trying to protect all citizens’ access to the marketplace.

Starting in July, Philadelphia’s new law will require most retail stores to accept cash. A New York City councilman is pushing similar legislation there, and New Jersey’s legislature recently passed a bill banning cashless stores statewide. A spokesman for New Jersey Gov. Phil Murphy, a Democrat, declined to comment...