What is wrong with this code?

The same is true of any function. All the arguments inside the square brackets will be expanded, before the function itself is evaluated. @IF is no different; the parser doesn't handle it differently.
Thanks for the explanation! (I was not aware of this, although it is quite obvious (in hindsight :-) )

Does this mean that @IF is not suited for things like:
echo %@IF[_%everything%_ == _okay_, Perfect, %@exec[FixDisaster.exe]]
or is there some clever way to work around this?