Updated solution per comment:
The fire alarm should not be connected to a switch at all. It's likely that it is connected to the same switch as the light but with the wires reversed. The solution would be to remove the fire alarm black & white wires from the switch and splice them in the box to the cable that feeds the switch, but before it "hits" the switch.
Old answer saved for posterity... i.e. it may help someone else:
There's so many ways to get into this situation and it's impossible to guess which one you're in but: Take a look at this site: https://www.homeimprovementweb.com/information/how-to/three-way-switch.htm It contains diagrams for all the different ways of wiring a light with two switches. Something you will notice about the diagrams is that there is no other load (device that consumes electricity) in the diagram.
In your situation a separate load, the fire alarm, was introduced into the two-switch system and it should not be. In each diagram you will see a section that says something like
From power source. This is where the electricity is coming in and this is where your fire alarm should be spliced in. i.e. The fire alarm should be connecting to the power supply before the two-switch system.
Now, how to fix this? If you're lucky the electrical box that feeds the fire alarm will have two separate three-wire cables running through it and it just happens to be spliced into the wrong one. In this case you just need to re-splice. But it's also possible that there is no 2nd wire in which case you will need to splice into whichever light-switch box (or possibly the fan box) and run a three-wire cable to your fire alarm. Yes, this could be just as painful as it sounds. If you have drywall up you may need to get into the wall to thread the cable between the boxes and then have to repair and paint...
In any case, good luck.
P.S. It's also possible that the power supply is coming into this system from the fan's electrical box. If this is the case then your worst case (having to bust through the drywall) becomes a little easier.
Here's a sample diagram (modified from option #1 of the web site given above) of where a separate cable may be spliced in so it doesn't behave the way you're describing.