Why does a heat engine convert only some of the heat into work I am aware that no heat engine can ever be 100% efficient due to the limit imposed by the 2$^{\mathrm{nd}}$ law of thermodynamics; and that the best we can do is reach the Carnot limit. 
When heat flows into the engine, it increases the entropy of the system (a rather obvious and well-accepted fact). Of course, before returning to the starting point, the system needs to get rid of this increase in entropy. My professor and textbook claim that this is done through dumping some energy into the environment, and thus emphasize that a heat engine can convert only part of the incoming heat into work as it needs to dump the rest to restore entropy.
What I do not understand is the engine does work, which is a form of energy transfer where energy leaves the engine, so why can we not have an engine where the work done by it restores its entropy, leaving us with zero energy having to be dumped to reduce entropy?  
 A: 
What I do not understand is the engine does work, which is a form of energy transfer where energy leaves the engine, so why can we not have an engine where the work done by it restores its entropy, leaving us with zero energy having to be dumped to reduce entropy? 

What you seem to be missing is the crucial difference between work and heat. The doing of work by an engine on the outside is the transfer of energy to the outside world in a way that does not increase the outside world's entropy. You might use the work done on a shaft to run a generator and then immediately dump your work into an electrical heater, obvious;y increasing the entropy of the outside world and thus telling against this statement, but my point is that energy as work can be transferred without a change in entropy. You might store that work by pumping water up a hill, to be reversibly extracted by a turbine some chosen time later, or by charging a capacitor.
Heat expulsion, in contrast, does increase the outside world's entropy, because it is adding energy to translational, rotational, vibrational .... degrees of freedom of the outside world.
In loose words that slightly shred precise usage, you can think of work as zero entropy energy and heat as maximum entropy energy (at least at thermodynamic equilibrium). 
But entropy change is a function of temperature as well as heat flow. The same heat flow into a colder rather than hotter system begets a greater rise in entropy of the former. So the engine can get rid of all its entropy increase that accompanies the heat flow into the engine at the intake temperature by dumping a smaller amount of heat into a system of lower temperature reservoir. This is why there is some energy left over to do work.
A: The short version is that energy can only go to one place. One Joule of work has been used up on mechanical energy and cannot be used to change the entropy. It's a simplistic model, but it's the reason $PdV=dE$ and $TdS=dE$ are different parts of the Conservation of Energy equation.
