RC filter in a simple PWM motor drive
C1 and C2 are needed to smooth out the the supply for low frequency noise and high frequency noise respectively.

I cant think of any reason to add a capacitor to the motor leads. Would probably just act as a lag for the motor to turn off and on. 

Any voltage spike from the motor will be dissipated through the diode