I'm not American, so I may be missing some details, but is that actually not allowed? Or is it rather the case that some people may not like that, so companies try to avoid upsetting some customers?
It is allowed, and some companies have based their business around it.
For that matter, I've received written correspondence from people while doing genealogical research with the return address listed as "Mobile, Alabama, Occupied CSA". There are definitely cultural norms that come into play here, but in that particular case - it was from an officer of a chapter of the Sons of Confederate Veterans and contained photocopies of Confederate military records - I was amused by it. I kept the envelope and included it in my own archives.
As others said, it may be allowed, and I did not know either ways but it was a rhetorical point.
Now even if it is allowed, suppose this was a Federal government procurement. Will Feds buy something with such flags? Nope. Once that happens, it can be easily demagogued.
I’m an American, but not involved in any kind of federal purchasing. I would have assumed that a federal purchaser would make up a reason not to buy my otherwise-perfect product if it had some unpopular statement on it, like a Confederate flag.
Do you know of any counter examples where a company was able to make a successful bid with a product that had good fit, but an inconvenient non-functional addon like that?
Yes, we can put whatever odious symbols on our products.
The Confederate flag is a bit weird because there's enough of the population that apparently doesn't see it that way, so some stores will even display products that have it. (Personally I find it to be an awful symbol and wouldn't stick around if I saw it displayed).
An example that is more like what you've described is something like a Nazi swastika -- technically you can sell something with a swastika on it (I'm 99.9% sure) but almost no stores would be willing to put it on the shelves, certainly no major chains or whatever.