You might argue that that database could contain a specific photo of a pride flag. You would be right, but there are safeguards against that. The system will not trigger with just one match. A set of multiple images must match. So no, the system won’t match a pride flag, and no the system won’t match a specific picture of a pride flag.
The next argument would be that a whole load of pictures of pride flags could be uploaded and then someone who has enough of those pictures would trigger a match.
This is true from a technical standpoint, but there are two more safeguards. The database is maintained by NCMEC, which is a non profit dedicated to tackling child abuse, and matches are visually confirmed by Apple.
So, to match someone who just happens to have a pride flag in a picture is not possible. To match someone who has a set of specific pictures of pride flags is only possible if both Apple and NCMEC collude.
So no - it can’t target a pride flag at all, much less as easily as CP.