I'm not sure your first sentence is true, or even meaningful.
The work done on the gas is greater for an irreversible than a reversible process. BUT:
For expansion, the magnitude of the reversible work is greater, but the sign is negative, so reversible expansion cools the gas more.
For compression. the magnitude of the reversible work is lower, but the sign is positive, so irreversible compression heats the gas more.
Either way, the final temperature is higher for the irreversible process (for the same final pressure). Your teacher is right.
Consider. The work done is -∫pextdV. For a reversible process, pext = pgas throughout. For an irreversible compression, pext > pgas (most simply, pext = pf throughout). So the magnitude of the work will be greater for an irreversible compression; contrariwise for an irreversible expansion.