SPI signal showing up on other pins of ATmega1284P microcontroller?
Pin 40 is an input i.e. it is relatively high impedance (compared to an output or a power supply line). That's the first important thing to note.

Next you connect your o-scope probe to it and now you have basically a high impedance pin connected to what could be described as a medium length antenna.

Is it any surprise that something might be seen? You might also find that if you hold the scope probe close by in several areas, fast transients on the SCK line also couple to the probe.

General layout of breadboard could easily cause the spikes to appear (to a lesser extent) on any other pins. If it's on a PCB with a decent earthplane and the scope earth wire is connected to the closet 0V pin you may still see a little spike - this would be due to the scope probe acting as a loop antenna.