Philadelphia has disputed a state ruling that it should not have spent money from opioid-related legal settlements on home repairs and small businesses in an area ravaged by the drug epidemic.