Prior to Siddhartha's birth it had been prosephied that he would become a saint. Because of this prophesy his parents were scared and kept him sheltered away from the world. Siddhartha was raised in wealthy existenance in a protected environment that did not enable him to see the realities of what people endure in the world on a daily basis. He knew nothing of poverty, sickness, death, hunger and so forth.
When Siddhartha went outside of the castle into the world and saw all that happens in real life he was saddened by such events and decided that the only way for him to reach spiritual enlightenment was for him to live in the same poverty that many others lived in and he did so for some time - renouncing all that was his in the manner of wealth afforded to him by his family and position.
After awhile he learned that depriving himself to the point of doing without basic needs was not the core of Buddism, but that the core was to live in moderation.
Moderation meaning not to live extravagantly but to have basic needs met if so equipped to have them met. And to give to those less fortunate so that their basic needs are met if one is fortunate enough to do so.