That being said, did Descartes ever state why one even has the ability to doubt?
I assume we can all agree that we indubitably have the ability to doubt; it is impossible to doubt that one can doubt. So, we have to take the presence of this ability as a given.
But why we have this ability? To ask this question assumes the Principle of Sufficient Reason (that is to say, that nothing happens without a reason.) Although Descartes doesn't explicitly thematize this principle (the way Leibniz, for example, does) he appears to endorse it insofar as he argues that all things ultimately come from God. (The question of whether or not God is subject to the PSR is another issue altogether, for Descartes.)
So, the implied argument would be: we were created by God, and we have the ability to doubt, so therefore the ability to doubt came from God.
Descartes doesn't (to the best of my knowledge) make this argument explicitly, but it seems pretty easy to connect the dots.