Funny, I remember that happening to me at one point, but a restart fixed it. Never did figure out what caused it, but if you haven't restarted since it started happening, might be worth a shot.
This only happens for me when I tend to operate faster than my computer. For instance, launching firefox then clicking on a window and keep working... firefox will load in the background. But that's just because I clicked to bring a window to the foreground - so I expect it to happen this way.
Any chance you're doing the same click to another window before the app launches?