Mcp23017 getting very hot within seconds

Why should it?
And obviously it doesn't or it would not get hot.

This is what happens when you lay out a PCB and forget that from the underside pin 1 is the upper right hand corner, not the upper left.

Can you post the PCB track side for that part.