When you have finished tithing every tithe of your produce in the third year, the year of the tithe, you shall give to the Levite, to the proselyte, to the orphan, and to the widow, and they shall eat in your cities and be satisfied. Then you shall say before Hashem your God, "I have removed the holy things from the house, and I also have given it to the Levite, to the stranger, to the orphan, and to the widow, according to all the commandment you commanded me; I have not transgressed any of Your commandments, and I have not forgotten. I have not eaten of it in my mourning, I did not consume it in a state of contamination, and I did not give of it for the needs of the dead; I have listened to the voice of Hashem my God; I have acted accordingly to everything You commanded me. May you look down from Your holy abode, from the heavens, and bless your people Israel, and the land you gave us as you swore to our ancestors, a land flowing with milk and honey". (Devarim 26:12-15)
This passage is known by Chazal as "Vidui Maaser", the maaser "confession". Normally a "confession" means to admit something you've done wrong. But in this passage, you mentions the various things you've done RIGHT! So why is it called a "confession"?
I think the answer is as follows. There is a principle in the Torah of "lo yerau panai reikam" (Shemot 23:15) - you are not allowed to visit the Temple empty-handed. The direct application of this principle is that when you visit Jerusalem on holidays you must bring a sacrifice (see Hagigah 7a). But it could work as a general principle: your visit cannot be selfish, you must perform some act of recognition and gratitude to God when you come.
In general, one must take two tithes from one's agricultural produce, the first going to Levites. In normal years (1,2,4,5 of the shemita cycle), the second tithe is called "maaser sheni", and must be eaten in Jerusalem while one is pure, almost like a sacrifice. Every third year (3 and 6 in the cycle), "maaser ani" takes the place of "maaser sheni". This tithe must be given to the poor rather than eaten by you, and the poor may eat it outside Jerusalem ("in your cities").
When you visit the Temple in a "maaser ani" year, you come WITHOUT the "maaser sheni" you normally bring. You breach the expected protocol for a Temple visit, and for this you must apologize. Of course, it seems strange to apologize to God for doing what God commanded you to do. But presumably the point of "lo yerau panai reikam" is give to you the right attitude on your Temple visits. If you cannot get that attitude by bringing a gift, you must get that attitude by noting and explaining the absence of a gift.
As a parallel, imagine that upon visiting someone for Shabbat you were expected to bring some kind of gift, like flowers or a bottle of wine. (Well, you are, but imagine that it was extremely rather than moderately impolite to not do so.) Imagine that you visited someone several times, but once you showed up without the expected gift. You explained this as follows: "I'm sorry I didn't bring you anything. I was actually planning on bringing a bottle of this delicious wine I just learned about, but on the way here I ran into a poor person who couldn't afford to purchase wine for this Shabbat, so I gave it to him instead. Hopefully you'll understand."
If the hosts were good people, they'd understand. So does God, if you shown up at the Temple without the wine and other food you'd normally bring as "maaser sheni". But in both cases, while you have a good excuse for not fulfilling your normal obligation, you still need to ask forgiveness for it.
Most of the passage is written using the word "I": I have done this, I have not done that. One would expect that since "I" performed all the good deeds mentioned in the passage, now "I" have the right to ask for a reward for "myself".
But the passage does not say that. It asks God to "bless YOUR PEOPLE ISRAEL, and the land you gave US". The person making the declaration is asking not only for himself, but for the entire people, even though he may be the only person who performed mitzvot and deserves a reward.
Not only is this a generally good model for prayer, but it is especially fitting for this particular mitzvah. The whole significance of "maaser ani" is that your wealth is shared with other people who need it. In your declaration, you ask that God's blessing similarly be shared with other people who need it.
In effect, you are pointing out that YOU were willing to share your wealth, so GOD should be willing to share HIS wealth as well. Surely, you say, God cannot be any less generous than you have been. How could such a request possibly be turned down?