Why did the founding fathers make the President the commander-in-chief of the military?

That was to insure that a military coup was virtually impossible. Washington had been the head of the army, and it made sense to allow him to carry on with that position, and, in the time of crisis a singular voice would be able to act in the national interest.

Along the same lines, it insured that the Civilian Government was the legitimate superior of the military. That is, that the military was legally subservient to the civilian government. This is an important (if often overlooked) design feature of the American government form, whereas the military is discouraged from influencing governmental decisions.