It depends on whether your GM considers a corpse to be a creature
There are already (at least) four other questions which delve into whether or not a corpse is considered a creature and/or an object:
There are answers going both ways on many of them with no clear consensus, so let's see how that effects the results. We can see from the following Q/A that if a creature stops being a valid target for a spell, then the spell is suppressed:
The fly spell states:
You touch a willing creature. The target gains a flying speed of 60 feet for the duration. When the spell ends, the target falls if it is still aloft, unless it can stop the fall.
If we assume that a corpse is not a creature, then the target dying will turn them into a corpse, and thus no longer be a creature. The fly spell will be suppressed. This means that they will no longer benefit from the spell and will fall.
If we assume that a corpse is a creature, then the target dying will turn them into a corpse, and nothing will change. The fly spell will continue to exist. This means that they will continue to hover/float/fly due to the the rules on "Flying Movement":
If a flying creature is knocked prone, has its speed reduced to 0, or is otherwise deprived of the ability to move, the creature falls, unless it has the ability to hover or it is being held aloft by magic, such as by the fly spell.
According to the Rules As Intended from Jeremy Crawford, a corpse in an object, so a creature would fall when it dies
Jeremy Crawford has made an unofficial ruling (a tweet) regarding corpses:
Is a dead or unconscious creature officially an object?
A corpse is an object. An unconscious creature is a creature.