Is it ethical for a PI to tell university to pay out intern's salary for an extra month after internship ends, and keep the money? There is an intern sharing the office with me. Once day his PI came to talk to him. Since there were only 3 of us in the office, although I didn't pay attention, their conversation just automatically went into my mind.

The story is like this: the intern had worked for 2 months, and he was going to leave. However, he would not let the university know that he was leaving. Instead, the PI would tell the university that the intern would work for another month. When the intern received the paycheck of the last month, he would send it to the PI.

At first, I think this was not right, the PI was stealing project money for personal use, and I needed to do something. However, in second thought, I think he might be the best one to deserve that money.

After all, he is the sole PI of the project, and there is no co-PI. The funding of the project comes from a (very competitive) external grant that he has spent a lot of effort to write proposal etc.

I think it is not very fair for the intern, since he has worked really hard, even in the weekend, so that the project can be shorten. He is going to start his PhD, and has promised to continue to work on that project in his free time.

Although it is not very fair for him, he will not benefit at all if I take any action. In contrast, he may still really want to continue the collaboration that way. This PI is friend of my boss (PI), I haven't talked much to him, but he appeared to be a nice guy. This is surely none of my business.

TL;DR: I know the PI cheats the system, but is it still right ethically given the fact that he has to fight really hard for this grant money? What should I do in this situation?
The person who owns the money for a project is not the PI, nor even the university, but the funder who has supplied the money.  The university, and through that organization the PI, is essentially granted custody of the money, and it is their responsibility to ensure that it is disbursed to the appropriate persons in compliance with their contract and the rules of the funder and university.

What you have described is pure and simple embezzlement, and needs to be reported to a responsible authority.  It's possible you misheard, but if you're certain about it, you have a duty to report, or else you are aiding and abetting the embezzlement.

Now, how to report safely is a potentially difficult issue.  If there are people in the university administration that you can trust to take action, that would be one route.  In the United States, you can also often report directly to the funder, often including through an anonymous hotline designed for just such occasions.