On my long bike tour I brought spare spokes.. used one in 10 years, 3 long tours..
if the nipple broke your spoke may not have been long enough..
if you never check your wheels and give them some service time at the bike shop , so they can tension and true them occasionally..
that is why it broke , it got looser but you ignored it.
....