Given the very stringent mass requirements, why was such a complex design choosen? I think an irregular shape weights a lot more than a squared box, not to mention the complexity to build it. I saw in a documentary that initial idea was a spherical ascent module, immediately abandoned due to complexity of constructing a sphere... then why did they change their mind?
The reasons for the LM having the shape that it had is pretty well explained in Chariots For Apollo, in particular chapter 6. That chapter also has this picture of the evolution of the LM design:
(source: Chariots For Apollo, chapter 6)
The image shows mock-ups from (left to right) 1962, 1963, 1965 and 1969.
The descent stage design was settled on pretty early. It's not much more than an engine plus propellant and oxidizer tanks with legs on the outside.
For the ascent stage, they started out with a spherical shape with large windows for visibility down (for landing) and up (for docking with the CM). However, big windows were undesirable for a number of reasons and Grumman (the LM manufacturer) had to abandon them and with them the spherical shape:
The importance of visibility was recognized early in Houston's studies and stressed in Grumman's original proposal. In both, large windows afforded an expansive view. Grumman had featured a spherical cabin like that of a helicopter, with four large windows so the crew could see forward and downward. This design was discarded because large windows would require extremely thick glass and a strengthening of the surrounding structure. The environmental control system would have trouble maintaining thermal balance. Two smaller windows could replace the four large ones, but the field of view would have to remain very much the same. To get the required visibility with smaller and fewer windows, Grumman had to abandon its spherical cabin design. The new cylindrical cabin had a basically flat forward bulkhead cut away at various planar angles; the large, convex windows gave way to small, flat, triangular panes (about one-tenth of the original window area canted downward and inward to afford the crew the fullest possible view of the landing area.
So they tried a cylindrical shape, with the windows protruding from the front, but this posed insurmountable manufacturing problems, in particular where the windows and hatch would meet the cylinder's round shape.
This is were the LM design started to have all kinds of "odd" surfaces, mostly to create enough visibility for situational awareness. However, the LM really started to look strange in 1965, when Grumman was tasked to remove 1100 kg from the LM weight in order to meet the payload limit of the Saturn V:
Really worried now, Grumman launched a two-pronged attack known as "Scrape" and "SWIP." Scrape meant just what the word implies, searching the structure for every chance to shave bulk off structural members. But SWIP Super Weight Improvement Program was Grumman's real war against weight. [...]
By the end of 1965, Scrape and SWIP had pruned away 1,100 kilograms, providing a comfortable margin below the control weight limit. [...]
Many of these weight-reducing changes made the lander so difficult to fabricate, so fragile and vulnerable to damage, that it demanded great care and skill by assembly and checkout technicians. Structural components took on strange and complex shapes, requiring careful machining to remove any excess metal - a costly and time-consuming process even after vendors had been found who would make these odd looking parts.
(source: ibid, chapter 7; emphasis mine)
The complex shapes were one of the reason why the LM was always behind schedule: they were incredibly hard to manufacture and very fragile, complicating assembly.
To summarize: the LM shape is so irregular, because it had to maximize visibility while minimizing the amount of material used, while still providing enough space for the crew and all the equipment and systems. And yes, it did add complexity (and delays because of that), but the weight problem didn't leave them another choice.
The LM ascent stage is made up of several components which individually have simple shapes; the end result looks more complicated than it is. Each individual component of the LM does have a simple, easy-to-manufacture, and mass-efficent shape.
The crew cabin is a cylinder with a horizontal axis of rotation, which is the next best thing to a sphere in terms of mass efficiency. The front face of it is shaped by the requirements of the forward hatch and the downward angled triangular windows.
Behind the cabin is a rectangular box structure containing equipment.
The distinctive “cheeks” of the stage are formed by large spherical fuel and oxidizer tanks; due to the specific mixture ratio used, the tanks are very different in size, so need to be positioned just so to balance the center of gravity. A shell of very thin, lightweight angular paneling shrouds the tanks, protecting them from direct sunlight and possibly micrometeoroid or debris impact.
A square or cube would be a bad choice. The cabin should withstand the internal pressure, the forces caused by the pressure should be uniformly distributed to the walls of the cabin. A sphere allows constant tensile stress to the walls. The next best choice is a cylinder with hemispheres at both ends.
A uniform distribution of tensile stress allows minimal wall thickness and minimal weight.