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?
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.