Lived in one state worked another

I am a full time resident of Illinois but work full time in Missouri.  My payroll department I didn't need to withhold Illinois taxes but when I started to file my state taxes, I am looking at a good size refund for Missouri but a huge amount owed to Illinois.  I paid taxes to Missouri for wages earned in Missouri, I live in Illinois.  Why would I have to pay taxes on earned wages twice? That doesn't seem right?