There is an option
"Require password <time period> after sleep or screen saver begins"
in the Security preferences, general tab. I'll bet yours is set to something other than "immediately".
Is the mentioned option set to something else than "immediately"? If it allows you to log back in that certain period of time after explicitly logging out, which it shouldn't (it should only work that way after sleep or screen saver begins, from its description) it might be a bug in OS X itself. You should try testing it a bit more and submit a bug report on http://bugreport.apple.com/ if it indeed looks like a bug. :)