TL;DR: The term "closet" shows up much more in American writing and speech because closets (the architectural feature) are much more common than wardrobes (the piece of furniture) in American homes, and have been for a century or more.
I agree with GEdgar's answer that in the US, a closet is an architectural feature—essentially a small room (possibly very small)—whereas a wardrobe is a piece of furniture (or possibly the collection of clothes that can be held in either).1 In my experience, the terms are not generally used interchangeably for either the built-in home feature or the casegood, though I can imagine that in a pinch someone who couldn't bring to mind the appropriate word for a piece of furniture might call it a "closet thing" or similar.
Both terms are also in extended use: For example, a large packing box fitted with a bar for hanging clothes is typically called a wardrobe box (see, e.g., U-Haul); there are many different types of closet (linen closets2, supply closets3, coat closets4, etc.); and when something doesn't quite fit either category advertisers may employ both terms at once, as in the Honey-Can-Do® 68-Inch Steel Freestanding Wardrobe Closet (from retailer Bed Bath & Beyond), a wire shelving unit whose blurb reads:
Update the inside of your closet or create extra storage space with the Honey-Can-Do freestanding wardrobe closet. This portable system keeps clothes, shoes and other items organized.
Thus the word closet is not really preferred over wardrobe in the US in the sense of having replaced it as the "correct" term—both terms are still in common use by most adult AmE speakers, just for two different concepts. However, the word "closet" is, indeed, far more common in American speech and writing. For example, a Google Ngram comparing "closet" and "wardrobe" (case insensitive; typical Ngram caveats apply) shows that as of 2000, the term "closet" was almost three times as common as "wardrobe" in Ngram's American English corpus. In fact, "closet" has been more common than "wardrobe" in American English writing for over two centuries. The usage of "wardrobe" held fairly steady from 1800–2000, whereas "closet" gradually declined to the mid-1960s and then began a fairly steep rise.
The reason for this disparity has to do with architectural history: in the US, built-in clothing storage, AKA closets, are virtually ubiquitous, and have been for a very long time. This means that there is less need for furniture in which to hang clothes. So we talk about closets more than about wardrobes, because we have more closets than we do wardrobes.
The New York Times reports in their timeline "A Few Niches in Closet History" that an early-adopter of closets in that city was a luxury apartment building constructed in 1880. A real estate expert quoted in the associated article5 notes that today,
In general, regular closets are 3 by 5 feet, while walk-in closets are 5 by 8 feet . . . .
But the timeline also highlights a couple of "closets" that look more like entire rooms or even boutiques, the new aspirational closet (full disclosure: I converted a small second kitchen in my 1900 farmhouse into a "sleep-in" closet, complete with its own closet, though the contents are nothing like as luxe as Carey's/Carrie's).
In parts of the US where space is at less of a premium, closets have been common for even longer. A couple of articles on the history of Iowa home architecture6 show small closets in homes built as early as the mid-1800s, and common for houses built by the end of that century. And modern homes in the US are expected to have a closet in every bedroom (even if that's not usually a legal requirement).
In this architectural context, wardrobes (the clothing storage furniture item) are used largely by folks with what most Americans would consider sub-standard closet space. One article, which recommends various wardrobe options7, opens:
So you've found the perfect apartment, with great light, in a great neighborhood, only — it doesn't have any closets. You could throw away all of your clothes, or, if wearing the same outfit for the rest of your life sounds like too much of a sacrifice, you could check out some of these ideas . . . .
Note the dramatic pause (punctuationally speaking) introducing the desperate lack of closets.
In fact, there is so little call for separate furniture for hanging clothing that there is a small cottage industry dedicated to repurposing such furniture. As DIY columnist Elise Moreau puts it in her Decoist article "15 Creative Ways to Repurpose an Old Antique Armoire",
An antique armoire can bring a sense of timeless elegance to any home, but not everyone can find a proper use for one — not to mention sufficient space too! In the old days they were used to store clothing and linens back when bedrooms didn’t have closets, and today some people use them to hold their televisions — but that trend perhaps isn’t as big of a deal as it once was now that TV screens are so flat and compact. In any case, if you do have the room for it, i[t] certainly isn’t impossible to find some kind of use for an armoire.
1 The piece of furniture is also sometimes called an armoire, and if it is combined with a chest of drawers it may be called a chiffarobe. I'm sure there are other terms in regional use, too—possibly even closet. I note that even Merriam-Webster lists "a cabinet or recess" as a possible meaning of closet, so it's likely that someone in the US says this or did at one time, but it is far from common now.
2 (M-W; traditionally literally for towels and bed linens, but now likely to also house other bed & bath necessities)
3 The Free Dictionary; just what it sounds like, but usually found at places of business rather than in homes
4 TFD; found generally near the entrance(s) of a home
5 "Closets, Please, and the Bigger the Better", by Elissa Gootman, April 5, 2013
6 See "A Historical Look at Architecture in Iowa." The Annals of Iowa 38 (1967), 481-500 and Peterson, Fred W. "Tradition and Change in Nineteenth-Century Iowa Farmhouses." The Annals of
Iowa 52 (1993), 251-281
7 Nancy Mitchell, “Ideas & Inspiration: Storing Clothes in Apartments with No Closets”, Apartment Therapy, Dec. 29, 2015