Some windows in OS X Lion do not move to foreground when taking focus
I've noticed this in versions of OS X as far back as Panther. It seems to happen more often with apps that use heavily tweaked windows (like Microsoft Office, Adobe apps, or Java apps, particularly Eclipse).

It's just a bug in the app. File a report with the vendor if you want and maybe they'll be able to fix it.