How to easily send data from one arduino to another?

That is normal if you don't pull the pin up or down with a resistor, or activate the internal pull-up. It is picking up stray signals.

Also you may want to make B count a transition. That is it was LOW and it is now HIGH. Not just add one if it happens to be HIGH.