WARNING: For simplicity sake the following information is conceptional correct even though it isn't 100% technically correct.
The TwineScript within a Passage is generally processed and executed statement by statement from top to bottom.
In your example the (if:) and (else:) macro statements are processed before the two hidden named hooks statements are, this means that at the time either of the (show:) macros are executed the two hidden named hooks don't exist yet which is why one of them isn't made visible.
If you move the two hidden named hooks so that they are before/above the (if:) macro then the relevant (show:) macro will work.
|one)[You clicked one]
|two)[You clicked two]
(if: $var is 1)[1 (show: ?one) ]
(else:) [2 (show: ?two)]
The reason placing the (show:) macro within the associated hook of a (link:) macro works is because the content of that associated hook isn't processed or executed until after the user selects the link, and that selection can't occur until all of the Passage as been processed so the hidden named hooks with exist.