There may be a few rare localities that require it, but it's not normally required.
Rather the definition requires a certain size of the room.
> room can be considered a bedroom if it contains a closet, alcove, indentation or wing wall which creates an area greater than 12 inches in depth.
https://www.sanbruno.ca.gov/civicax/filebank/blobdload.aspx?...
> is capable of being used for sleeping quarters that contains a closet, or to which a closet could be added, may also be considered a bedroom.
In Europe though, where armoires are a thing, and I actually can’t remember living in any home that had a closet in any room with a bed, I don’t see closet being in the definition.
I keep seeing rumors that there are localities that require a closet, but no one ever actually names them.
It may be a persistent rumor in your locality as well.
> Fittingly, property assessors will follow the same bedroom definition when determining the number of bedrooms in a given home—that is, it must have a door, a closet, and an egress window. It is in the interest of homeowners, sellers, and buyers to know the subtle bedroom definition differences between the safety/builder perspective and the real estate/home value perspective, and to know one’s state and local guidelines for determining what can and cannot be considered a bedroom.
https://www.bobvila.com/articles/406-what-makes-a-room-a-bed...