Last month I've read two books by Mark Twain (Huckleberry and Life on the Mississippi) in which he twice refers to a form of punishment well known to Europeans through the famous cartoon character Lucky Luke. But what is less known is that there's nothing specifically American in this practice since it has been imported from England where it had been in use at least since the Middle Ages.
All the same, there doesn't seem to have been that many cases of tarring and feathering as compared to another English import: the lynching, which, incidentally was far more serious since it was a death sentence.
Both practices were never official punishments of the US but spontaneous acts of revenge emanating from the mob. Which also helps to remind that since the early years of the colonists, the American population was made up of peasants, not exactly known for their level of sophistication, as opposed to people from the cities (which is also very relative given the times). It also is a reminder of the hardship it had been to develop and install a reliable system of laws and regular jurisdictions in the US.
Hence probably, the emphasis that is given to said rule of the law in America as the ultimate symbol of a regular State. This is also probably the reason why this theme is so prevalent in so many films and serials made in the USA. To an extent that is always surprising to non-Americans.