Yes, if we think about it from the perspective of the survivors and the relatives, writing such a work is very much questionable. If I had been the victim of a tragedy, would I want someone to write a book about me? Certainly not!
And the fact is that this might even be illegal, depending on your jurisdiction. People have the right to control, as Wikipedia phrases it, "the commercial use of their identity". That is why film studiesstudios buy the rights to someone's story before making a film of it.
Now some events, like 9/11, involve so many people that you won't be infringing on anyone's personality rights if you make up fictional characters who might have been involved in it, and if you are respectful in your narrative few of the survivors or relatives will feel offended by your story. In fact it is very likely they won't even take note of it among the many documentaries and fictionalisations out there.
So, the more people were involved in some tragedy, the less "immoral" any single retelling of it will probably feel. No one considers it unacceptable to write a story about the drug trade, for example, no matter how far from reality your story might be.
The same goes for historical distance. Once everyone involved and their immediate relatives have passed away, there aren't any people who could be hurt by your retelling. Their community might find your book disrespectful, but even that fades when a century or more has passed.
Legal aspects aside, the more recent the event and the fewer the victims, the more I would fictionalise it. I would have absolutely no qualms at all writing a story about someone who had lived in the 19th century. But I would append my narrative with an account of what was historical fact and what I had made up.