Harmful: Could very well be. Do NOT do it again. Sounds like what happened was that the low-level firmware in the motherboard (that runs the clock) got hit hard enough by the shock to clear it, hence the reset. That should never, ever happen.
It sounds like the MBP wasn't plugged in at all when this happened--is that right? And that the part that generates a spark is the outside metal shield on the small computer end of the connector, not any of the inner pins, correct?
Based on what you're describing, you've got either a faulty piece of DisplayPort hardware, or seriously messed-up wiring in your house. The displayport connector does carry power, but it should only be power going to the device, not coming back from the other end. So even if something was badly shorted in the DP connector, it seems like you shouldn't get any kind of spark when touching the computer end of the cable to anything, since there's no voltage in it at that point.
If, however, you have either a badly messed-up device on the other end of the DP cable (what monitor is it, specifically?), or the ground/neutral pin on the outlet that the monitor is plugged into isn't at ground potential, I could imagine a situation where that shield (which I assume is normally electrically connected to the rest of the cable and monitor shield, which is usually ground) was at some significant voltage. Now, if the computer wasn't plugged in at all, then I'd think the only current path through it would be through whatever it was sitting on (unless there was a USB hub cable plugged into the monitor already?), so I'd expect some substantial voltage to make a visible spark.
The alternate possibility is that it was a static discharge, which could theoretically do what you described, unless it happens every time. Do you live in a very dry area, or usually have static problems?
I wouldn't hook that monitor to anything until I got it figured out, lest you get unlucky and permanently damage the computer with a shock.