Is it unethical to enroll in a low-ranked institution with the intention of switching to a better one if possible? I am an international student who has been admitted at a low ranked institute in the US. I also have an offer from an institute in my own country to do a Masters'. I ultimately want to get admitted at a prestigious program in the US. 

I was recently advised to join the low ranked US institute, do my course work well, establish contacts with professors at more prestigious schools, and then switch to a better school for a PhD. It sounds immoral to me. But I was told it is not immoral in practice as the institute receives thousands of offers to fill up the seat you will be vacating. 

Is doing the above seriously unethical?
This is far from immoral or unethical. Theres nothing wrong with attending a program and transferring to another one that might be a better fit.  Making the transfer to another program would really be up to you, your work and the networking contacts you make while in your masters program.