I’ve attached a link to a test file. If you press p to run it then hit the spacebar, it prints to the console twice. I even tried just attaching the keyboard sensor to the controller, skipping the update of my counter but I get the same result.
In my game I have a mouse over and left button sensor instead of just a keyboard sensor but I get the same result.
The sensors provide the controllers with two pulses
a positive pulse when changing from negative to positive state and
a negative pulse when changing from positive to negative.
This means each controller will be triggered twice. The python script controller is also a controller. The script must decide if it want to handle the pulse or not.
In your case you get a positive pulse when pressing space. This triggers the actuator to add 1 to the property.
Your change sensor produces a true pulse as the property changes from 0 to 1. This let your script run.
If you release space you get a negative pulse. The AND controller does not forward this pulse to the actuator as the condition is false. the property remains unchanged.
The change sensor sends a negative pulse as the property does not change anymore. The script is runs again.