My adviser wants to use my code for a spin-off, but I want to use it for my own company
Actually, I do not really understand your general strategy: If the code is published under MIT license and the details of the algorithm are published, then pretty much anybody can use this code or algorithm for his/her own company (as far as I understand the license, I am not a lawyer). So it is perfectly fine for your supervisor to use this code. It is also perfectly fine for you to use this code in any company you found (again, as far as I understand the license details).

Probably, a scientific algorithm will only be a tiny part of software that you want to sell or for which you want to consult. So I would not worry too much.