Why do I owe NYS taxes if I only lived in the state for 9 months, and worked here 7 months?

Last April I moved to NYS. Spouse got a job in June, I then received a permanent position in August. I owe quite a bit in state taxes for NY and not sure why.