Don’t have a complete answer here but here is the First Reading for Ash Wednesday: (the other readings are: Psalm 50: 3-6, 12-14, 17, R v3; Second Reading: 2 Corinthians 5:20- 6:2, Gospel Matthew 6:1-6, 16-18)
"12Yet even now, says the Lord, return to me with all your heart, with fasting, with weeping, and with mourning; 13rend your hearts and not your clothing. Return to the Lord, your God, for he is gracious and merciful, slow to anger, and abounding in steadfast love, and relents from punishing. 14Who knows whether he will not turn and relent, and leave a blessing behind him, a grain offering and a drink offering for the Lord, your God? 15Blow the trumpet in Zion; sanctify a fast; call a solemn assembly; 16gather the people. Sanctify the congregation; assemble the aged; gather the children, even infants at the breast. Let the bridegroom leave his room, and the bride her canopy. 17Between the vestibule and the altar let the priests, the ministers of the Lord, weep. Let them say, “Spare your people, O Lord, and do not make your heritage a mockery, a byword among the nations. Why should it be said among the peoples, ‘Where is their God?’”
18Then the Lord became jealous for his land, and had pity on his people. bible.oremus.org/?passage=joel+2
So here we have biblical support for collective fasting for the repentance of sins. We also have Nineveh, where the people tore their clothes, wore sackcloth and ashes to repent of their sins and avert the chastisement of the Lord. There are more Scripture references at this site Scripture Catholic - Fasting.
Also, here is the Catechism on Fasting, one of the Many Forms of Penance in Christian Life
The fourth precept [of the Church] (“You shall observe the days of fasting and abstinence established by the Church”) ensures the times of ascesis and penance which prepare us for the liturgical feasts and **help us acquire mastery over our instincts and freedom of heart.**85
Fasting, abstinence and sacrifice all serve to wean us from the material world which only seduces us away from the things of God. Not that these things are all bad, but they have their place and should not be given more importance than necessary. We need to eat to live, but we don’t live to eat. We value our closer relationship with God all the more and we learn to disdain our fleshly instincts.
We practice saying ‘NO’ to our fleshly desires by picking something really very small and easy, like fasting from one particular item (giving up something for Lent) either a food or a habit. It exercises our ‘NO’ muscles. That is why we are supposed to choose something we really like. It is like increasing the weights at the gym to make you stronger. Then, when we are faced with a temptation that is stronger than wanting to have a hamburger or a steak, that we know is a sin but the flesh wants to do anyway, we can say, "NO, this is displeasing to God . I rule my body, my instincts, they do not rule me " and not give in because we are stronger in not giving in to temptation.
This is especially helpful in today’s world where we are bombarded daily with the message,
“If it feels good, Do it!”