State argues sober home ordinances are illegal, forcing cities to make expensive decisions