I've seen several variations: (really comes down to something "illegal" happened, electrical or otherwise)
1) From the building department: a bright red or other florescent colored tag or sticker that is posted on the main entrance(s). This will post both the illegal condition (e.g. uninhabitable / untenable residence) and will list the reasons why, with the signature of the AHJ (not necessarily the electrical inspector). I've seen where a GC attempted to have a "open house" or even having people move in prior to having occupancy (in new construction) I've also seen it where slumlords try to rent out places that our local housing authority deems untenable (in existing construction).
2) From the utility: A black meter tag means they didn't pay the bill. I've solved a lot of power outage / service calls just by going to look at the meter first (e.g. where a landlord says the tenant is w/o power). I've yet to see the utility issue a red tag, (which I'm sure they do in cases of power theft & such)
3) From OSHA: On a construction job, a red tag issued by OSHA can completely stop work until certain requirements are met. (Trust me you don't want this one). In this case you WILL be notified of it even if you are not issued the "red badge of courage".
Now on to the one you probably want a clue on:
4) The local electrical inspector: They decide to red tag a job. It can mean a failed inspection, but a red tag goes beyond this. It normally means some serious infraction of rules occured (e.g. NEC or local codes were knowingly & willingly ignored). AHJ has the right to issues fines & such, and in my area has been known to order services disconnected & leave the customer w/o power until such issues are resolved.
The red tag means someone did something they shouldn't have (duh!) and I've seen there is usually a LOT of ignoring the rules before it gets to that. Worst case: no occupancy and/or service disconnected for the premises, fines issued, licenses lost, on and on...
Bottom line: you don't one on any job you ever do.