There is no logic that can necessarily explain this behavior. Instead, consider how someone holds the picture or article of clothing of their deceased relative or kisses it. This gesture just signifies how important that symbol of the relative is to them. In the same way people associate the flag with the holy people and by it, a form of emotional blessing (hence the wiping). They are not worshiping it, it is just a symbol