Answer:
Yes, it's not only illegal but a felony.
Step-by-step explanation:
Taking, tampering with, vandalizing, destroying, or even looking at mail that's inside someone else's mailbox is a serious crime. Mailboxes are considered government property to make it easier to ensure that mail has been delivered with no issues.
If someone receives a misdirected package, it would be best to knock on the door of the place the mail was directed to, leave a note for them, or leave it in the mailbox for delivery staff to come pick it up on their next round. Never put the mail directly into their mailbox unless you're a postal employee.