The main purpose of fasting during Ramadan is to cleanse oneself and to become a better and more spiritual purpose.
During Ramadan, Muslims are not just supposed to refrain from eating and drinking during the daylight hours. Instead, they are supposed to try to refrain from any bad actions during that time. They are supposed to be making their entire life as much like an act of worship as possible.
When Muslims do this, they are trying to become more spiritual. They are trying to leave worldly things behind to the extent possible and to focus more on their faith and their spiritual lives.
Ramdhan just doesnt teach us to refrain from food, on the contrary it also teaches us how the poor are able to bear with hunger so also we should try to understand and the value of remaining hungry and feed the when they come to us. It also teaches us to help the needy.
Besides Ramadhan is just not the month os fasting and feasting but it also is a month to give alms to the needy. During this month all muslims who are in a position or who have an priscribed amount of gold and silver belongings, it is must for them to donate to the the needy. By doing this one realises how one can help those in need.
This helps the man to compulsory give away some thing in the name of Allah and by giving away something you are coming close to almighty. For Allah loves those who give alms for he is thinking about others. He forms the habit of giving to others and becomes a donor or helper.