(Summary: In this post I argue that you need at least an energy of $m v_1^2(1-\cos(\theta))$ in the idealized kinematics situation to deflect an asteroid of mass $m$ and velocity $v_1$ by an angle $\theta$ using rockets, without changing the magnitude of $v_1$.)
Energy isn't the be-all and end-all of motion. The problem is that momentum also has to be conserved.
Let's say that our rocket is attached to our asteroid. So, the initial energy of the asteroid+Rocket fuel is $\frac{1}{2} (m+M) v_1^2$. But we're accelerating the asteroid with a reaction mass, so if the momentum of the fuel/rocket/asteroid system is $(m+M)\mathbf{v}_1$, then after some amount of time of the rocket firing (let's say all of M is expelled), we have to have: $m\mathbf{v}_1'+M\mathbf{v}_2 =(m+M)\mathbf{v}_1$ where $\mathbf{v}_2$ is the mass-averaged velocity of the gas expelled by the rocket. This system then has energy $\frac{1}{2}m v_1^2+\frac{1}{2}Mv_2^2$ (where mechanical energy isn't conserved, since we have fuel exploding, and we've assumed that $v_1'^2=v_1^2$ - we just change the direction of the velocity). So the energy we've had to give the system is $\frac{1}{2}m v_1^2+\frac{1}{2}Mv_2^2-\frac{1}{2} (m+M) v_1^2=\frac{1}{2}Mv_2^2-\frac{1}{2}M v_1^2$. Doing some algebra: $\mathbf{v}_2=\frac{(m+M)}{M}\mathbf{v}_1-\frac{m}{M}\mathbf{v}_1'$. Plugging in, and ignoring the factor of $\frac{1}{2}$, the energy is proportional to:$$M\left(\frac{m+M}{M}\right)^2 v_1^2+M\left(\frac{m}{M}\right)^2 v_1'^2-2 M \frac{m+M}{M}\frac{m}{M}\mathbb{v}_1\cdot \mathbb{v}_1'-M v_1^2$$
$$=v_1^2\left(\frac{m^2+M^2+2mM+m^2+(-2m^2-2Mm )\cos(\theta)-M^2}{M} \right)$$
$$=v_1^2\left(\frac{2m^2+2mM-(2m^2+2Mm )\cos(\theta)}{M} \right)$$
$$=v_1^22\frac{m^2+mM}{M}(1-\cos(\theta))$$
As $M\to\infty$ our system gets more efficient, but we never get close to zero energy! We're always expending a bit more than this amount of energy:
$$m v_1^2(1-\cos(\theta))$$
Maybe that relationship can be derived through simpler means. It makes sense.
So yes, through using a reaction mass, it takes energy to deflect an asteroid.
This does not imply that the sun expends energy to deflect the planets, because we explicitly assumed that we were using rockets.
To summarize:
- No work is done on the asteroid.
- A minimum of $mv^2_1(1−cos(θ))$ is done on the rocket fuel.
- This result is due to conservation of momentum, meaning...
- If momentum isn't conserved (say we're modeling the sun as a fixed point w/ a 1r potential), then this result won't hold and it might not take energy to deflect the asteroid. THIS is the sense in which it doesn't take energy to deflect an asteroid, but it breaks momentum conservation.