WordPress loop : how to exclude some posts with their status?

You have the line global $posts; which is probably pulling a globalised $posts variable defined somewhere else and thus overwriting the one you just made. Remove that line or change the variable name to something unique.