Hindus are divided into many different sects. Some sects which are based on "Vaishnava Smpradaya", asks the followers to do fasting once every month. The Hindu calendar follows lunar phase. So, every month the 11th day of full moon phase, is considered the auspicious day to observe fasting.
The basics of Hinduism are found in great texts written around 6000 years ago. Bhagavad Gita is one of them which forms very integral terms of Hinduism. This text clearly states characteristics of being a Yogi, to lead spiritual path, and be enlightened. Gita is very much specific about choosing food and eating habits. According to this great book, offering any substance in pure form to God is the best food. It also cites some substances as Basil leaves, flowers, fruits, and water which are pure and to be offered to God. It states that a true Yogi does not eat more, and also he does not eat less.
Later part of development in vedic texts which were written 3000 years ago, from them, Patanjali who established a system of "RajaYoga", declared 8 steps to become a "RajaYogi". Second step in this system is "Niyama". This step includes a sub-system called "Tapa". "Tapa" means habituate mind and body to suffer hardship. According to this system, "Tapa" purifies mind and body and makes one ready for advancement in spiritual path.
We can identify two different systems suggested for us to follow - one which favors suffering habit, the other denies it.
Now, let us add a different perspective to this topic. Physiologically, our body requires energy to digest food we take in. So, if we can fast for half day or full day, that energy can be utilized for other purposes. People in old time chose some period of time especially during monsoon which lasts for almost 4 months in India, to do fasting. During this period of year, people feel loss of appetite, and water and/or food contamination. So, doing frequent fasting allows one to tackle these issues.
In modern era fasting, people use food cooked with rock salt on the day of fasting. But, this is not a correct way. The whole purpose of fasting is not realized in this case. The best way to fast is to use water only during the day. Some people even prefer not to take water. They do "Nirjala" (literally meaning without water and any food) fasting.
Fasting is considered allowing one to divert attention from food to soul. That allows one to seek path to the truth.