It's pretty common to hear that a fight favors ranged over melee. Relatively few fights favor melee over ranged. So let's take a look at why this happens.
In my experience, most fights don't punish you for taking melee, they punish you for taking more melee than normal. Put another way, it's easier to take extra ranged DPS than it is to take extra melee DPS.
So what are the advantages that ranged has over melee?
1. Any effect that hits one melee usually hits all the melee.
Usually if there's an effect that melee needs to avoid, all melee have to avoid it at the same time. However, you very rarely see an effect target all the ranged simultaneously. Usually the ranged can spread out, so that only a portion is hit at any one time.
This also shows up in effects that "chain" from one target to another. It's easier to organize ranged such that chain lightning hits a minimum number of people. It's much harder to do the same for melee.
2. Ranged can go to melee, but melee cannot go to ranged.
If a fight does favor melee, ranged can often avoid it by running into melee range. Take Magmaw, for example. A common strategy is to have most of the ranged DPS stand with melee, with minimal people standing out at range to be targeted by the specials.
If ranged could not do this, it's arguable that Magmaw would be considered a melee-friendly fight, instead of a draw.
Not saying it would be a completely good idea, but if ranged had a 10 yard minimum on their spells, the balance between melee and ranged would be very different.
3. Any effect that affects the ranged will also affect healers.
The healers are usually at range, so any environmental effects will often affect them as well. That means that there is a maximum to what can be done to ranged without making it impossible to heal.
As you can see, it's not so much that individual melee classes are weak, but more that melee and ranged are affected by mechanics differently. Add to that the ranged can "pretend" to be melee characters, and pretty much every advantage ends up falling to the ranged.
Fixing this might be pretty complicated. Large fixes, like a minimum range for ranged, are not really feasible at this point.
The best way to go is probably identify the ranged classes and have effects target those characters. For example, when Magmaw does flame pillar, rather than targetting "a character at range", he instead targets "a ranged DPS spec" even if that character is standing in melee. That would allow melee specs to avoid some mechanics, while preventing the ranged specs from running into melee range.