I'd say that calling the lack of modularity an outright sin glosses over the engineering reality behind why the F-35 variants aren't as common with each other as initially planned.
https://www.youtube.com/watch?v=RQ5gmZ74YBY
Here's Jon Beesley, the pilot who did first flight in the F-35, along with quite a bit of the early air worthiness work. He is discussing the weight reduction efforts associated with what was called SWAT, STOVL Weight ATtack.
Originally the three F-35 variants were supposed to have about 75% of their structures as either common (identical) or "cousin" (largely the same but with some minor differences) parts. In other words, the F-35 was supposed to be modular. Unfortunately, this made all three variants overweight. This matters most for the F-35B, where extra airframe weight directly reduces bring-back weight and cuts into the performance margins of STOVL flight.
Starting at 2:15, he discusses the modularity issue directly (with a bonus discussion on scope creep!) "Holes are really heavy." For every hole, you must have a more robust structure around that hole to maintain overall structural integrity. A modular aircraft meant a heavier aircraft, so heavy that the F-35 was in great danger of being too heavy, missing a key performance parameter for the contract. Eliminating the modularity was the way to make the F-35 meet this performance parameter.
It's all about engineering tradeoffs.