Chamirts sakanta m’isura (one must be more stringent on matters that present a danger than matters that are “merely” issur).
In my opinion, having a smoke detector is more important than having a mezuzah!
After all, the dorming girls may not even have (on them) a chiyuv to have a mezuzah on their rooms since they can always be ordered to switch rooms, so they have no kviyus dirah. But a smoke detector is a chiyuv d’oraysa of v’nishmartem…