You are looking at a vacuous implication. Let me explain at length:
Let $A = $ "unicorns exist"
Let $B = $ "it is raining"
Now,you are saying that because $A$ is false, it should not depend on whether $B$ is false or $B$ is true, which is why the proof of contradiction does not work.
So the original statement to be proved is $A \implies B$, or "unicorns exist imply it is raining".
You take the contrapositive : $\neg B \implies \neg A$, which is "it is not raining, then unicorns don't exist".
An implication is a statement of the form "IF P IS TRUE THEN Q IS TRUE". It says absolutely nothing about what the nature of Q is when P is false!
Hence, the contrapositive is true, simply because the statement Q (which is $\neg B$), is true all the time! And hence if it is not raining, of course unicorns don't exist.
Similarly, the statement "unicorns exist imply it is raining" is true, because unicorns don't exist, and you do not know whether it is raining or not based on the existence of unicorns,hence the implication is true.
"If ducks fly then it is friday tomorrow" is true, because ducks don't fly, and we don't care whether tomorrow is a friday or not, because we are expected to care only when ducks fly, which will never happen.
"If I turn green in colour then I will have a vodka" is true, because I can't turn green (hopefully) and we don't care whether I will have a vodka or not, because we are expected to care only when I turn green, which I never will (hopefully).
An implication "False implies something" is called a vacuous implication. Based on the following examples, what it basically means is the following: I only care about the something if the first statement is true, which it never is, so I never care about the something, and my statement is true.
Let me give a mathematical example:
Let $B$ be the set of all odd natural numbers. Let us look at two statements:
P: $a$ is an element of $B$ and is an even number.
Q: $17$ is a divisor of $a$.
Now let us ask if $P \implies Q$. Indeed, $P$ says that the number $a$ is an odd and even number, which never happens, so $P$ is identically false. Hence, $P \implies Q$, because if $P$ is never true, then there are no cases to check for the falsity of the above statement, hence the above statement is true. In other words, we don't care whether $Q$ is true or false, when $P$ is false. We only want to make sure that $Q$ is true whenever $P$ is true. And that happens. Hence $P \implies Q$.
Read up the connection between vacuous implication and set containment. You will understand why everything above is correct.