There is in fact a non-religious purpose for fasting: Health benefits. Specifically, this is known as "Intermittent Fasting" or IF:
https://www.davedraper.com/fusionbb/fbbuploads/1282684030-RobbWolfNutritionCollection-1.pdf(The section concerning IF begins on page 11, but that entire .pdf is nutritionist porn.)
People who practice IF go without food for a 15-24 hour period several times per week. When they aren't fasting, they're gorging on food to make up for the fasting periods. You read that right; after fasting for an entire day, they eat two days worth of food the next day.
It sounds ridiculous, but it's been proven to have significant benefits for athletic performance, insulin sensitivity, fat loss, and even strength and muscle gains. The rationale behind it is that humans evolved eating this way, because animals and nomadic peoples often go for long periods of time without food and once they kill something they usually consume huge amounts of calories in a single feeding.
However, IF is rather advanced stuff and isn't exactly recommended for someone who has no clue about what they're doing (ie. anyone with a resolution to lose weight after New Year's). It's mostly practiced by athletes who know their bodies inside & out and are looking to break fitness plateaus. Given that very few people aspire to realize the limits of their athletic capabilities, IF certainly isn't something that's necessary to live a healthy lifestyle, unless of course your current approach isn't working.