Lots of things will kill a betta.
Your betta probably wasnt that old... They live from 2-5 years under good care. Becomming pale so suddenly is a sign of stress..
If your tank was small (gallon and under) and wasnt being cleaned and having water changes more than 100% each day (for under a gallon) or 50% one day, 100% the next for 1-1.5 gallons, he probably died of a dirty ttank/ ammonia build up. Also, for example, cleaning a tank and changing the water in a 2.5 gallon tank less than 50% twice a week will lead to stress and other factors that will harm it.
If your tank was unheated, less than the needed 76'-82' range, he was probably cold- leaving their bodies open to stress which will cause them to contract illnesses much faster and easier.
If your betta was not being fed the correct diet or too infrequently, well, thats a bit obvious. Things like frozen blood worms all the time provide little nutrients and will harm your fish. Too infrequent of feedings will cause stravation, etc. Too much will cause bloat or other complications leading to much the same.
If your water wasnt conditioned, the chlorine might've gottten him.
Or he couldve contracted something that hurt him and caused him to pass.
Im sorry to hear your little guy died, and I hope that your next will live longer for you. Take good note of these things and if you think they were a factor, correct them for your next fish. Theyre hearty little things, but theyre not invincible and do pass for many many reasons.
Good luck with everything in the future,a nd sorry to list so much- just covering all the reasons I can think of <3