How does ripples in dc affect working of a dc motor?
Given the inertial behavior of a typical motor, the ripple in supply will not cause significant adverse effect. 

The most noticeable effect, for really large ripple factors, would be an audible buzz at the ripple frequency.

It is fairly common practice to provide unregulated DC to the motor drive line - more efficient than consuming some of the delivered power at a regulator. 



Edit: Clarifying based on comments:


Mechanical inertia: A rotor with any non-trivial mass, once rotating, will continue to rotate even if a transient drop in Voltage occurs sometime within the cycle. Thus, the motor will not come to a halt or stutter noticeably due to ripple. The "stutter" that might occur on really poorly regulated power (e.g. full wave rectifier with no reservoir caps) will generate the audible buzz mentioned above, at twice line frequency
Electrical inertia: Any inductance electrically behaves as an inertial element: It resists change, as mechanical inertia does. Thus, the coils of the motor concerned will themselves serve as a means of smoothing out the supply power. This is the reason very cost-sensitive designs tend to use smaller reservoir caps when driving an inductive load, compared to driving a non-inductive one.


Both these elements contribute to simplifying power feed design for conventional DC motors - so long as the line frequency and its first harmonic are not resonant with the motor's rotation rate or (rotation rate x number of coils). Resonant power ripple can tear apart a motor pretty quickly.

As indicated in comments by Dave Tweed and Andy Aka, a reactive ripple reduction method i.e. a (bigger) capacitor as opposed to a linear regulator, will improve efficiency: 


For a current Ipeak, motor torque is proportional to average value 0.6366 x Ipeak while resistive losses are proportional to RMS value 0.7071 x Ipeak.
For pure DC, these become equal, so efficiency is maximized.