Scalpers are essentially opportunistic. They see that there is a significantly higher demand than supply, and they also see that, in terms of emotional value (particularly in relation to scarcity), some items have a value higher than the retail price to many people. So they exploit this opportunity.
This happens every year with iPhones in particular.
It isn't really an issue if it's not denying people who really need something, like starving people needing food or infected people in Africa needing an Ebola vaccine (if you think about it, this helps to put the Apple Pencil mania in perspective - you won't die if you don't get it)
This doesn't make it morally acceptable, but as someone already mentioned, the stock market works on similar principles - emotions affect the true value of an item, and people who live off the stock market exploit this.
For material goods, this usually doesn't last - if something is in sufficiently high demand, someone will manufacture an alternative to fulfill that demand as another avenue of profit. First thing that comes to my mind is natural and synthetic rubber.
But the really irritating part is that no one can duplicate the Pencil easily. It's built to work specifically with the iPad Pro's technology. It should have been included with the iPad Pro. Contrast with the keyboard, where you at least have the Logitech Create keyboard as an alternative (albeit not a particularly inspiring one).
At the end of the day, humans are being humans... there's really only one villain in this whole drama... and that's Apple supply chain and their crummy underestimates of the demand for the Pencil.