In the Gen 1 cartoon continuity, The Quintessons created the Transformers. So, the real question is: why did the Quintessons choose a "humanoid" form?
But there's a problem there.
What are we calling "humanoid"? The fact that they have a body shape that has roughly the same anatomical structure as humans?
We never learn just how long ago the Transformers were created in the Gen 1 Cartoon Continuity, but we know from the episode War Dawn, that the beginning of the war between Autobots and Decepticons was roughly nine million years ago - long before Australopithecus or humans evolved on Earth, but not primates in general.
So, let's look at a couple other characters who share similar body shapes.
During the Gen 1 cartoon, we meet characters like Bosch, Lord Gyconi, and Aron. In all of these cases, we have aliens which share similar body shapes as humans, but are much more advanced technologically (at the very least, they all have interstellar travel). It is safe to assume that they evolved long before humans did.
But how much earlier? Let's keep looking at some more characters..
And Unicron's creator, Primacron.
In the Gen 1 cartoon continuity, Primacron created Unicron "at the dawn of the galaxy." Again, we never learn exactly how old the galaxy is in the Gen 1 Cartoon continuity, but it's safe to say that it's a lot older than when life even began on Earth.
So, really, Transformers don't have humanoid robot forms at all - it's actually the exact opposite. Humans have Transformeroid bodies.