The details you need to answer your question are in the second and third stanzas of the poem. Here's the first four stanzas, to give you the full context, of "The Ballad of Father Gilligan," by Yeats. They include the details you ask about:
The old priest Peter Gilligan
Was weary night and day;
For half his flock were in their beds,
Or under green sods lay.
Once, while he nodded on a chair,
At the moth-hour of eve,
Another poor man sent for him,
And he began to grieve.
‘I have no rest, nor joy, nor peace,
For people die and die’;
And after cried he, ‘God forgive!
My body spake, not I!’
He knelt, and leaning on the chair
He prayed and fell asleep;
And the moth-hour went from the fields,
And stars began to peep.
I've emboldened the lines that include what the priest sees as his grievous sin, and italicized his repentence. Actually, his reaction is probably quite natural. Members of his flock are dying faster than he can deliver the Last Rites to them. He is dozing off in his chair when he gets summoned by yet still another dying parishioner. He is overworked and exhausted, but when he reacts to the summons in a very human way, he sees his words and behavior as not fitting for a priest. He grieves and explodes, figuratively, and then is immediatley sorry for what he says right after he says it.
God, in the poem, though, seems to understand. While the priest is praying, begging for forgiveness, he falls asleep and misses the man's dying moments, but God sends an angel in the priest's place to administer the Last Rites.
Father Gilligan grieves at the beginning of the poem because he is old, tired, and overworked. He has, it seems, had a long and tiring day. But instead of being able to relax, he gets summoned by yet another person needing his help.
When you say that he repents, I assume what you mean is that he immediately asks God's forgiveness. He says that was just his body speaking. He repents because he knows that his job is to try to give comfort to other people -- sort of as God gives him comfort in the rest of the poem.
W.B.Yeats' "The "Ballad of Father Gilligan" is a moving story of how God comes to the rescue of a sincere priest whose only concern is the salvation of the souls of his impoverished parishioners.
Father Gilligan who was exhausted in fulfilling his priestly duties day and night during an epidemic in the Irish countryside, either in giving the last communion to his poor parishioners who were dying in large numbers or conducting funeral services for them, was at home one evening taking a well deserved rest and had dozed off in his chair.
Just as Father Gilligan had dozed he was disturbed from his sleep by the urgent call of another dying parishioner. Wearily, Father Gilligan began to grumble and murmur about his lack of rest:
'I have no rest, nor joy, nor peace,
For people die and die;
But the very next instant he checks himself seeks God's forgiveness and kneels down by the side of his chair and begins to pray:
And after cried he, 'God forgive! My body spake, not I!'Father Gilligan seeks God's forgiveness for his murmuring and grumbling by saying that it was his weak and fatigued body which complained and not his spirit and mind which were keen to save the souls of the dying villagers. As he continues to pray he is completely overwhelmed by sleep. The tired Father Gilligan slept the entire night kneeling down by the side of his chair. Early in the morning, at dawn he woke up to the cheerful sound of the chirping sparrows.
Poor Father Gilligan realized his mistake and rushed off to the house of the dying parishioner, only to be greeted by the dead man's widow with the news that he had actually come earlier on and had ministered the last communion to the dying man and by doing so had ensured the salvation of his soul:
The sick man's wife opened the door,
'Father! you come again!'
It is then that he realizes that God the Creator had taken pity on him who had worn himself out completely in His service, had sent an angel to minister the last communion to the dying man:
'He Who is wrapped in purple robes,
With planets in His care
Had pity on the least of things
Asleep upon a chair.'