Im sorry to hear that, sounds terrible. Some animals will just not make it, it is called failure to thrive, remember in the wild the vast majority of offspring will not survive to maturity, many snakes will die in the egg or soon after hatching, or be taken by predators. Atleast you gave the snake a proper and comfortable home for his sadly short life.

Don't give up on snakes! They make amazing pets and will bring you tons of great experiences and companionship for decades to come. If you do decide to get another snake perhaps you should pick an animal which is a little older and better established that way you are assured of its health and vitality, there are many reputable breeders to choose from and most good breeders will not sell an animal unless it has been feeding regularly. A more established snake is way better if it is your first reptile.