The town of Marana, northwest of Tucson, acted illegally in putting the whole cost of a sewage treatment plant upgrade on future development.
The state Supreme Court ruled it was unfair to put the burden of the project on new homes.
The court ruled the project will benefit the community and should be paid for by all customers.
Justice Clint Bolick cited a 2011 law specifically stipulating development fees cannot be used to impose a burden on new residents when it's beneficial to all taxpayers.
In a prepared statement, town officials said they will determine whether current customers will have to pay for a larger portion of wastewater facility costs.
The town improved wastewater quality standards through a plant acquired from Pima County and put all of the debt service on future homes.
The Supreme Court ruling takes the case back to a trial judge to determine how the costs of the project should be allocated.