We now very little about the treary between the Cardassian Union and the UFP that created the DMZ. For all we know the Federation got most of the terms it wanted.
We do know it was bad for the Federation colonists who ended up on the Cardssian side of the DMZ, because the Cardassian government ended up giving weapons to its colonists and in turn the Cardassian colonists did everything they could to drive the Federation colonists out. The Cardassian Union did not sign this agreement in good faith. So in the end the Federation looks either extremely naive and incompetent or just cruel and uncaring to plight of its own colonists, either way the Federation doesn't come off good in that episode.