These differences are a reference to sexual dimorphism, which is commonly seen in many real lifeforms and may offer some clues to their biology and behavior.
Source: Bulbapedia/ Gender Differences
It is like real animals.
Some Pokemon have extreme differences (ex: Unfezent), while others, not so much (ex: Venusaur).
This is an extreme example.
On the Left: Female
On the Right: Male
Not every single one has to be EXTREME. Look and dogs and cats. Just small changes, but overall, same body structure and color and other things.
Could you tell which is which gender??