Why did Cessna get rid of manual flaps in their 172?
Nobody can definitively answer this for you except Cessna's 1965/1966 engineering team (the year they made the change), but there are two reasons I can think of:
Because switches are cooler than Johnson bars; or Because everyone else is doing electric flaps.

Much like with manual transmissions, some people just don't like the extra work of manual flaps, and for those folks electric "flip a switch and don't worry about it" flaps are a selling point. 



In terms of reliability it's a trade-off (as are all engineering decisions), so let's look at a few of the factors:

Mechanical Flaps


+Flaps still work when the battery is dead.
+The pilot can control the extension/retraction rate to some extent.
+Usually cross-linked with a bar (so you can't have a "split-flap" condition)
+Simple to rig, adjust, and maintain.
-Actuation requires more pilot skill
You need to develop the muscle memory to grab the handle without looking.
You need to learn to govern the extension/retraction rate smoothly.
-The failure mode is usually "Flaps Up"
You could lose your flaps on short final if the cable or lock mechanism fails.


Electric Flaps  


+"Easier to Operate" (you don't need to reach down to the floor)
+Extension/Retraction rate is constant (governed by the motor)
+Fewer moving cables running through the fuselage (wires replace them)
+Typical failure mode (e.g. dead battery) is "Flaps stuck where you left them"
Less chance of losing your flaps on short final.
+Depending on the design they may save some weight over a mechanical system.
-You lose control of the flaps if the battery dies (no-flap landings are more likely)
-You have one or more motors to maintain/replace if they fail
-Depending on the design it's possible to have a "split-flap" condition


Cessna's engineers and marketing folks looked at those factors (and probably many others) and decided that electric flaps "made sense". On the other side of the GA fleet, Piper's engineers looked at the same factors and decided to keep the Johnson bar flaps (which are still found in the PA-28 series today).

From a manufacturing standpoint it makes sense for all of the aircraft a manufacturer produces to use the samecontrol mechanisms -- either all the planes use mechanical flaps or all the planes use electric flaps because it simplifies production and allows everything to run through on one assembly line rather than stopping at the flaps and diverting aircraft to different teams.