Why so extreme? Would you deport someone for tagging a bus stop? Shoplifting? Public intoxication? Or is it the m that they are ungrateful about the privilege of being allowed to be in this country? And for citizens that they aren't showing respect and pride in our country?
Historical conventions in this case. "Planting the flag of your nation" tends to indicate you're claiming that area
for your nation. So trespassing onto a government facility,
removing their flag, and replacing it with your own could, after a fashion, be considered an act of war against that country. As you just essentially "claimed" that facility in the name of the your own nation.
Obviously, there is a lot of other nuance and additional factors in play with regards to the use of national flags, particularly when not in their respective nation. But those contexts don't generally revolve around trespassing.