Getting Unwanted Transitional Values from Push Button Switch
Mechanical switch contacts "bounce" both when making and when breaking.  Bounce is when the contacts make partial, higher resistance contact or bang into each other repeatedly and very quickly.  It is common for contacts to make and break 5 or 10 or even 100 times in a few milliseconds.  Depending on the circuit the switch is driving, this can be taken as an intermediate voltage or as 100 really fast clock pulses.

The standard way to fix this is to "de-bounce" the switch with an electronic circuit.  Two common methods are 1) any one of a group of circuits that essentially act as a lowpass filter; or 2) have the switch input clock a flipflop.  Once a "1" is clocked into the flipflop, multiple successive clocks have no affect.  With this method, you have to reset the flipflop before it will respond to another button press.