Thee are a few different things that could have caused the problem, necropsy is the only way for sure to say.
Sorry for your loss, loosinga pet at any time is hard, loosing one so suddenly is a bit traumatic.
The spleen bleeding it could have been fromone of a couple cancers, an old injury from falling or slamming into a surface that caused scar tissue, the scar tissue could have caused a rupture if the injury earlier in life was deep - that’s why puppiesshouldnt be on beds or do stairs until they are old enough or tall enough that a fall won’t be fatal. If the dog liked jumping heights like when catching frisbee that has been known to happen. Car accidents as well as dog fights and trauma like a hard kick to the area, but I will add there would be good amounts of bruising in the area if the dog would have been kicked. If you knew it was the spleen it means the vet did a partial necropsy at least and would have mentioned the bruising and trauma around the area.