A pall does need to replace a flag while the casket is in the church. However, flags can be placed on the casket before or after it is in the church. The Order of Christian Funerals states:
38. If it is the custom in the local community, a pall may be placed over the coffin when it is received at the church. A reminder of the baptismal garment of the deceased, the pall is a sign of the Christian dignity of the person. The use of the pall also signifies that all are equal in the eyes of God (see James 2:1-9). . . . Only Christian symbols may rest on or be placed near the coffin during the funeral liturgy. Any other symbols, for example, national flags, or flags or insignia of associations, have no place in the funeral liturgy.
132. Any national flags or the flags or insignia of associations to which the deceased belonged are to be removed from the coffin at the entrance to the church. They may be replaced after the coffin has been taken from the church.
This prohibition seems to be based on the fact that, in the Church and in death, we are Christians first and foremost and that we are all equal in God’s eyes. Thus our equality as Christians is represented by the pall as a token of our baptism. Any other affiliations we may have had—having belonged to the armed forces, having been members of a particular association, etc.—pale in comparison to our identity as Christians. The pall is appropriate because the funeral liturgy is sacramental in context, and the person’s reception of the sacrament of baptism will be mentioned during the liturgy.
Keeping national or association symbols out of the funeral liturgy also helps keep the Church from being politicized or being seen as endorsing a particular association or set of policies. Imagine what erroneous conclusions people might have jumped to if the Nazi flag had been present on coffins in churches during World War II. People might have thought that the Church endorsed the Nazi party or the German war effort, which it certainly did not. Indeed, it strongly opposed both.
Rather than putting priests in different countries in the difficult situation of having to say "yes" to some flags and symbols and "no" to others, it is simpler to keep them all out and to cut the Gordian knot by not having any symbols testifying to the person as anything but a Christian.