They exist by tradition, mostly. Flags are holdovers from ancient times before people reached the stars. In space, there really was no point to a flag. More often than not any flag seen was painted on a hull. But only high resolution optical sensors could see them from any real distance, and those were more interested in threat identification through hull design than splashes of paint.
Largely, as a means of identification, of representation to an ideal, flags were useless. Flags only had one use, one reason why Alliance ships carried them, and carried lots of them.
Arrayed in Atlas’s third cargo hold, Flynn walked among the nineteen caskets all adorned with the flag of the Alliance. Each flag would be carefully folded and passed along to next of kin.
It was tradition.