No one knows for sure, but one explanation traces this superstition back to World War I.
During that war, soldiers spent a lot of time in trenches, watching for an enemy attack and for enemy snipers. Soldiers believed that by lighting a match at night and using it to light three cigarettes, they were giving enemy snipers time enough to aim at the flame and pick off the match holder, or the third person using the match.
So “three on a match” became not only unlucky, but dangerous!