In addition to the above answers, the third crewman on the CSM performed visual checks of the LM after separation before descent, photography duties, regular purging of fuel cells, reconfiguring and relaying communications from the LM to mission control and platform alignments. Some of these may be possible from the ground.
I guess it was also a big comfort to have a guy on board just in case of some failure which would result in the loss of attitude or communication (and control) of the CSM. It's not just for computer backup. For example, a mechanical failure like some gas leak could push the CSM off attitude and through gimbal lock. That might be easily correctable by a guy on board, yet pose major problems to fix from the ground if communication was lost, and could prevent the LM from docking and kill everyone.