Is it just too difficult to program machines to do that? Or is clothing production contingent on other factors besides just sewing together fabric?
Thick wetsuits are particularly hard problem, because material is both yieldly and stiffy.
But the form is typically to create flat fabrics, which are then assembled into finished products. That involves cutting, sewing, and finishing. The field of textiles is literally a multi-millennial story of development of such methods, and it's a rich literature and discipline. I strongly recommend Bernadett Banner's exquisite YouTube channel for insight to it (focusing strongly on ~19th century fashion and practice): https://yewtu.be/channel/UCSHtaUm-FjUps090S7crO4Q
Much clothing relies on different materials or fabrics for different components, or at the very least, different arrangements, bias, layering, etc., of a uniform material, in ways which are far more readily achieved through cut-and-sewn fabrics than with a single uniformly fabricated medium.
And note that there are other materials used in clothing --- traditional fabrication involved wool, cotton, flax, but also leather (animal hides) and some other plant materials (barks and grasses) which might not necessarily be woven together.
There are some other manufacturing processes. Rubber products may be molded (e.g., latex gloves), there's some limited extrusion, and there are paper or Tyvek garments which may avoid traditional stiching or sewing (I'm not sure how panels are joined, though adhesives of thermal fusion may be used.)
Even with 3D printing, there are products which are sufficiently complex that they require additional assembly or modification. 3D printing isn't a silver bullet for normal fabrication, and other methods, including machining, shaping, molding, and casting may still be applicable. For highly-constrained material properties it may be necessary to control temperatures, materials, consistency, etc., in ways that present 3D printers don't support.
At industrial levels, clothing is phenomenally inexpensive, especially by historical standards. As late as the early 20th century, the typical resident of the United States or Western Europe had only two or three outfits. The combination of high-volume materials sourcing, highly-utilised capital equipment, and quite often extraordinarily low-cost labour means that cost of production for everyday garments is low. It's quite possible to sew your own, but this does require both time and skill, which at scale is much less efficient than mass-manufacturing methods. There are people who pursue this as a hobby or craft, but they are the exception.
True fashion design and production to the best of my knowledge (extremely limited) remains highly bespoke and specialised. Per-garment costs are high. As to why, the video Bernadette did on the evaluation of a knock-off of one of her own dress designs is ... illuminating:
https://yewtu.be/watch?v=J80J4oaGVnY
I've watched multiple proposals for custom / bespoke clothing made-to-order on-site appear and faile, dating to at least the mid-1990s. There are brands which specialise in made-to-measure cothing, there's a slight premium, but the production itself remains highly centralised, and the market is as best I can tell still niche.
TL;DR: Clothing is largely "3D printed", though that's usually 2-dimensions. Further finishing is not readily achieved via additive means.
... and all that said, there is progress and research in the area. Wired from 2017, with developments and limitations.
https://www.wired.com/2017/05/the-shattering-truth-of-3d-pri...