the fact that the Federation was in a war against Bajor's enemy at the time makes it stupider that they didn't intervene to help them. In war, you ally yourself with those who are fighting your opponent. The Federation should have at least been supplying the Bajorans with weapons or something like that.
How do you know they weren't, at some point, doing just that? The Cardassian war happened almost entirely off screen. The Bajoran resistance certainly didn't seem to have much difficulty getting its hands on weapons.
But as far as fully 'allying' with them - there would be serious difficulty even finding a bajoran 'government' that wasn't in the Cardassians' pockets and had an even remotely legitimate claim to representing Bajor. The occupation had already been underway for decades and there, afaik, was no remnant left whatsoever of whatever indepedent militia Bajor might have had prior to the Cardassians' arrival. Nothing but informally organized resistance cells who don't even know each other's names.
So it's hardly surprising that the Federation didn't press the Cardassians on the subject of a planet which seemingly is pretty far away from Federation space when they couldn't even reach a peace agreement that allowed all actual Federation colonies to remain in the Federation.