I don't think it was stupidity on his part as such, but overconfidence (which can lead you to making stupid decisions). I'm pretty sure he believed Cardassia (i.e., him)
could keep a handle on the Dominioin. Re-establish your pre-eminence by making a pact with a powerful ally. When you've achieved the desired victory, turn on your ally. There was this plan to eliminate the Jem'Hadar by doing something to their white supply, if I remember rightly - which Damar had some details of on his PADD, which Rom then made sure got into the hands of the Jem'Hadar - which was the reason for that almighty bust-up in Quark's bar.
Also I honestly think his thirst for glory and power made him shortsighted in this instance. He couldn't think past the personal vindication of getting "his" station back.