but if the C172 is programmed to fly like this then it is bad programming.
a 172 will practically take off by itself in clean air and it would need a strong gale
Let's say I kind of doubt that (irrespective of the number of my posts). I've flown a few GA planes and sailplanes, and without exception they all require constant small control adjustments to stay in level flight. Only a fly by wire system gets you around it - because it does these adjustments for you.
What the keyboard does is discretize your control - each tap advances you by 0.05 (or so) - which means that if the required adjustment is smaller than that, you're overcorrecting and getting into a pilot-induced instability.
Don't blame the programming for your unrealistic choice of control device here.