What does the expression "being drug up on the carpet and then run up the mast" mean and where did it come from? It could very well be the person who said it made it up on the spot.
"being drug up on the carpet and then run up the mast"
It's a fine example of mangled idioms. I take it "drug up" is the writer's own way of saying "dragged up". He's probably thinking of "being dragged before the boss", but he's combined that vague thought with the phrase "on the carpet", which is used about people in trouble with their superiors. Not content with that, he progresses to an image of someone being "run up the mast" (picture it if you can). The only things that are actually run up the mast are flags or sails, and the popular phrase is exclusively used about the first. This is likely an exercise in free association, where the writer is thinking of "hanging from the yard-arm", but can't remember the exact words, so he latches onto the first substitute with naval overtones that springs to mind.
It's two separate idioms combined.
Being dragged up on the carpet (more commonly called on the carpet) usually means being called out on something. In other words, you are being made to answer to an authority for something. The carpet is seemingly a reference to being called into the boss's office where the floor would be carpeted.
Being run up the mast represents a public hanging (mast gives a nautical flavor to it, but the meaning is the same). Idiomatically it means being publicly humiliated or punished.
[Compare this to the similar, but unrelated, run it up the flagpole (and see who salutes it). This means to put it out there and see who agrees.]
Taken together, the two mean that you are being called out on an action, and then being publicly humiliated or punished for that action.