Perhaps this is taking the thread too off-point, but your statement isn't quite right. Of course a magnetic field does no work. But, if the strength of the field is variable in the direction of the field, then perpendicular energy (from cyclotron motion) will be converted to parallel (linear!) energy. By "perpendicular" I mean perpendicular to B, and "parallel" is parallel to B. This is why charged particles trapped in the magnetosphere "bounce" back and forth between north and south poles of the Earth's magnetic field. Likewise, one mechanism by which ionospheric ions are ejected out into the magnetosphere is as follows: wave processes accelerate the ions perpendicular to the Earths magnetic field; the fact that the field has a gradient in the direction of the field changes the perpendicular energy into parallel energy; the ions get enough parallel energy to escape the gravitational field of the Earth and they end up in the magnetosphere. This is why we sometimes measure significant quantities of oxygen in the magnetosphere - not much oxygen is in the solar wind!
If you are interested in this stuff, almost any plasma physics text will discuss this.
I'm sure the original poster wasn't thinking about this, which is why I didn't bring it up earlier.