USPS is (since 1970) an Independent Agency rather than an agency of the executive branch. This was sort of a semi-privatization measure that isolates USPS from the federal government, USPS operates mostly as a government-owned independent corporation. There are a number of other independent agencies as well, they way they relate to .gov domains varies. I don't think there's a well-settled policy on whether independent agencies should use .gov domains. Amtrak doesn't, the CIA does, NCUA does, Federal Reserve mostly doesn't (except the board which is a federal agency). I think it depends mostly on brand identity and how much they want to be perceived as private sector vs. government agencies, since independent agencies often straddle a line between the two.
USPS I think from a branding perspectives wants to be compared to retail shipping and not come across and some stuffy/slow bureaucratic agency, even though they totally are.
Lots of small towns have dot coms when they could have dot gov.