Why does your 2000 Pontiac Grand Am run rough at idle while in gear but runs smoothly if placed in neutral?

Why does my 2000 Pontiac Grand Am, with a 2.4L engine, run rough at idle but runs normally when placed in neutral? I changed the plugs and air filter, but the problem continues.