Who has called him a moron? He is obviously an incredibly clever guy. That doesn't mean he's above criticism though.
There's also a thing where you can be incredibly good in one or two related fields, but be absolutely useless in many others (sometimes worse than the average person).
People seem to think that Musk is some sort of super genius who is great in everything even things where he has no experience or education, and refuses to listen to advice.
Case in point, Twitter, he seems convinced it's all about programming and being "hardcore" at programming, completely missing the point that Twitter has to operate in multiple legal jurisdiction obeying multiple sets of laws about everything from the content it displays to the protections for the users, and the rights of the work force.
In that he's shown he's either more ignorant than many "average" people about those issues*, or that he's so arrogant he doesn't have to care about them and that there will be no consequences for breaking those laws.
As I've seen a lot of people put it, Twitter isn't about code so much as it's about human interaction and community (in both the legal and personal sense), and musk doesn't seem to grasp that at all. His obsession with "great code" and "working hardcore" utterly ignores what Twitter does/is and how it makes money. It's like buying a film production company and obsessing over say the Cameras and lighting used, whilst ignoring the fact you're dealing with humans and things like copyright and needing scripts/actors.
*I'm not a lawyer, i'm not a business owner, and I've never worked outside of the UK, but somehow I seem to be far more aware of the fact that employment law varies by region (even within the US) than Musk who has the ability to call on hosts of experts if he needs to call on them and realises/is willing to admit he needs that information.