This is probably too much of an over-simplification but when I imagine creating an EM wave by shaking an electron back and forth, my intuition is that shaking the electron faster (at a higher frequency) would require more work.
Shaking the electron faster would require more work, but this does not mean each photon has to carry more energy. It's possible to postulate a model where such electron would generate a greater number of less-energetic (and yet high-frequency) photons. In this model "high frequency has high energy" does not stand, but your answer ("shaking the electron faster (at a higher frequency) would require more work") is equally "good". The problem with this model is it does not match experiments. Since your answer can "explain" the right model and the wrong one, I say: non sequitur.
@DKNguyen I now understand a little that how more work is done and higher energy wave is produced by more shaking. But why more shaking or say higher frequency electron directly implies higher frequency EM wave?
This is dead wrong. The reason high-frequency photons carry more energy is exclusively quantum mechanical, and no amount of classical intuition is going to explain it. To be clear, within classical mechanics, higher-frequency shaking does not imply more work, since you're not specifying the amplitude of the shaking.
@Paul Given the position of this answer (high score on a "Hot Network Question", which gets advertised throughout stack exchange), it is now effectively acting as misinformation. I appreciate that this is unintentional, and the runaway effect of an answer which is intuitively appealing is hard to control. But this answer is doing more harm than good right now. Please consider a substantial edit, or other such measures.
I agree with @EmilioPisanty. This answer confirms the classic intuition, which is usually wrong when dealing with QM. Keeping this answer at the top will spread misinformation on top of confirmation bias.
The answer correctly says that shaking the electron faster requires more power, but this has nothing to do with the quantisation of that power into photons per second. The equation for the energy of a photon E = hf has nothing to do with the total power delivered.