The worsening budget situation of state, city, and other local governments has obscured a related, but much less straightforward, danger: complex financial transactions brokered for states and municipalities by Wall Street firms eager to make big money at public expense.