Really compensation has nothing to do with skill. Compensation has everything to do with a demand for that skill. A highly skilled photographer doesn't make as much as a dev-ops engineer simply because everyone with a camera can "take pictures" and to many people the difference between a Pulitzer-winning photo and a decent Instagram feed is marginal. Yet, most people that can open Illustrator or Sketch and "design" something, while most people can't simply open Vim and write an application.
My theory is that the value of a good designer is equal to the value of a good developer because they serve critical, though separate roles in building a product people both want to use and are technically able to use.
The problem though is that it's very easy to "be a designer" because it actually doesn't take much technical skill. (Let's not get into a flame war about the technical skill required to use Sketch or Illustrator -- I get it; I'm being relative.) It's less "tangible." Is design A better than design B? The data-driven among us could certainly quantify A vs. B, but generally designs are subjective. With developers, it's mostly objective: does the product do X when I click this button. If yes, pass, if no, fail. (Us developers know that's not all there is to it, but in the C-suite, that's really the key metric -- does it solve the business problem, many could care less about code quality or even maintainability, until the dev team starts demanding resources to solve technical debt!)
So, back to your original question, should a developer get paid more than a designer? While, I would argue good version of both deliver equal but different value and thus they should be paid the same, the reality is affected by supply and demand. There are more "ok" designers than there are good developers. Yet ok designers are often good enough because frankly many people don't know good design even if it slapped them in the face with a trout. So an ok design has the practical effect of being a good design. Meaning: the measurement criteria is simply "do I like the way this looks." While with developers, it's much harder to find a developer that can actually execute. Thus an "ok" developer isn't competing with an "ok" designer because "ok" developer could potentially not execute the project at all, or at least not efficiently (thus costing more time,) while even a bad designer can create something that is good enough.
Which means, ok designers are in high supply, while good developers are in relatively low supply -- which makes the price for those resources adjust accordingly.
All things being equal -- yes, they should be paid the same. However, all things aren't equal. Supply and demand and perception of value are major factors at play.