It's caused by the order in which the game iterates through particles.
Depending on the particle number it's given, a photon may move an extra three pixels when first created. This means it is out of sync with those that haven't moved an extra three pixels, causing a gap.
There is no way you can keep the beam free from irregularities when editing a laser. Just ignore them. They don't really matter anyway.
However, you can avoid irregularities when someone loads and runs the save without editing it:
Make sure when saving that there are no particles that will disappear (e.g. photons) that are currently anywhere above or to the left of the PCLN.