First, forget about the words "if" and "then", or even "implies". No, really.
Instead I'm going to start with something that looks completely unrelated, namely infinite sums. Don't worry, eventually it's going to lead to a nice explanation for why $\to$ has the truth table it does, but there's some ground to cover first to give the right perspective.
Infinite sums.
Suppose we want to write down the sum of reciprocals of squares of all the primes:
$$ \frac1{2^2} + \frac1{3^2} + \frac1{5^2} + \frac1{7^2} + \frac1{11^2} + \cdots $$
(This sum converges to a number near 0.452247 that doesn't seem to have a nice closed expression, but the precise value will not concern us here; just how to write down the summation).
In order to make the $\cdots$ precise, we'd want to write it with a $\sum$ sign somehow. What one writes in practice is something ad-hoc like
$$\sum\limits_{p\text{ prime}} \frac1{p^2} \tag{1}$$
but suppose the only summation operator we had was $\sum\limits_{n=1}^{\infty}$. We definitely can't write
$\sum\limits_{n=1}^{\infty} \frac1{n^2}$
because that would mean
$$ \frac1{1^2} + \frac1{2^2} + \frac1{3^2} + \frac1{4^2} + \frac1{5^2} + \frac1{6^2} + \frac1{7^2} + \frac1{8^2} + \frac1{9^2} + \cdots $$
which has terms we don't want. We need a way to "cross out" the terms that come from a non-prime $n$:
$$ \require{cancel}
\cancel{\frac1{1^2}} + \frac1{2^2} + \frac1{3^2} + \cancel{\frac1{4^2}} + \frac1{5^2} + \cancel{\frac1{6^2}} + \frac1{7^2} + \cancel{\frac1{8^2}} + \cancel{\frac1{9^2}} + \cdots $$
There's a straightforward way to "cross out" a term in a sum: just replace it by zero, giving
$$ 0 + \frac1{2^2} + \frac1{3^2} + 0 + \frac1{5^2} + 0 + \frac1{7^2} + 0 + 0 + \cdots $$
Thus we can write our sum as
$$ \sum_{n=1}^\infty \begin{cases} 1/n^2 & \text{when $n$ is prime} \\ 0 & \text{otherwise} \end{cases} \tag{2} $$
This works because $0$ is a netural element for the $+$ operation.
What we'd really like is to have a nice compact notation for the case analysis in the general term of (2). One possibility is the Iverson bracket which would let us write
$$ \sum_{n=1}^\infty [n\text{ is prime}]\cdot\frac{1}{n^2} $$
but unfortunately that notation hasn't really caught on, so in practice we need to write things like (1) if we want to be understood.
Infinite disjunction.
Moving on from analysis to logic, suppose we want to express the claim: There exists an even prime. Intuitively this is an infinite disjunction,
$$ \text{even}(2) \lor \text{even}(3) \lor \text{even}(5) \lor \text{even}(7) \lor \cdots $$
Fortunately logic provides us with a way of writing infinite conjunctions: $\exists$ is to $\lor$ like $\sum$ is to $+$! But we run into a similar problem as before, because if we just write
$$ \exists n\in\mathbb N: \text{even}(n) $$
we would get
$$ \text{even}(1) \lor \text{even}(2) \lor \text{even}(3) \lor \text{even}(4) \lor \text{even}(5) \lor \text{even}(6) \lor \cdots $$
which is not what we wanted to say (even though both claims happen to be true).
The solution to this is also the same as before: we cross out the disjuncts we're not interested in:
$$ \cancel{\text{even}(1)} \lor \text{even}(2) \lor \text{even}(3) \lor \cancel{\text{even}(4)} \lor \text{even}(5) \lor \cancel{\text{even}(6)} \lor \cdots $$
With $\lor$, the way to strike out a disjunct is to replace it by $\mathsf{false}$, because $\mathsf{false}$ is to $\lor$ like $0$ is to $+$. So we get
$$ \mathsf{false} \lor \text{even}(2) \lor \text{even}(3) \lor \mathsf{false} \lor \text{even}(5) \lor \mathsf{false} \lor \cdots $$
Or, going back to quantifiers:
$$ \exists n\in\mathbb N: \begin{cases} \text{even}(n) & \text{when $n$ is prime} \\ \mathsf{false} & \text{otherwise} \end{cases} \tag{3} $$
This is still a bit more cumbersome to write than we'd really like. Ideally we ought to have a logical connective to write the case analysis in (3) compactly, something like the Iverson bracket but for logic:
$$ \text{crossout}(P(x),Q(x)) \equiv \begin{cases} P(x) & \text{when }Q(x) \\ \mathsf{false} & \text{otherwise} \end{cases} \tag{4} $$
Surprise! If we write out the truth table for the case analysis in (4) what we get is exactly the same as the truth table for $Q(x)\land P(x)$. So we can finally rewrite our claim on a single line as
$$ \exists n\in\mathbb N: n\text{ is prime} \land \text{even}(n) \tag{5} $$
Infinite conjunction.
We're getting closer. Suppose we want to write down Fermat's little theorem: If $p$ is a prime, then $p$ divides $a^p - a$.
This is morally an infinite conjunction:
$$ (2 \mid a^2-a) \land (3 \mid a^3-a) \land (5 \mid a^5-a) \land (7 \mid a^7-a) \land \cdots $$
Now $\forall$ is to $\land$ like $\exists$ is to $\lor$ (and like $\sum$ is to $+$), so we can repeat the procedure from the previous section, where we cross out non-prime conjuncts and end up with
$$ \forall n\in\mathbb N: \begin{cases} 2\mid a^n-a & \text{when $n$ is prime} \\ \mathsf{true} & \text{otherwise} \end{cases} \tag{6} $$
Why is there now a $\mathsf{true}$ in the "otherwise" line instead of a $\mathsf{false}$? That's because the neutral element for $\land$ is $\mathsf{true}$ rather than $\mathsf{false}$.
So we can't reuse the final step that took us to (5) above; we need a new connective
$$ \text{crossout}'(P(x),Q(x)) = \begin{cases} P(x) & \text{when }Q(x) \\ \mathsf{true} & \text{otherwise} \end{cases} $$
Perhaps that would be $\lor$, since $\land$ worked the last time? Let's work out its truth table:
$$\begin{array}{|c|c|c|}
\hline
p&q&\text{crossout}'(p,q)\\ \hline
\mathsf{true}&\mathsf{true}&\mathsf{true}\\
\mathsf{true}&\mathsf{false}&\mathsf{false}\\
\mathsf{false}&\mathsf{true}&\mathsf{true}\\
\mathsf{false}&\mathsf{false}&\mathsf{true}\\\hline
\end{array}$$
Even more surprise! This is not the truth table of $p\lor q$, but it is the truth table of $p\to q$.
Finally $\to$ appears, with an explanation of where it comes from. It is simply the symbol we have decided to use for $\text{crossout}'$, no more and no less, such that finally write our claim as
$$ \forall n\in\mathbb N: n\text{ is prime} \to (n\mid a^n-n) \tag{7} $$
This finally gives us an answer to the question: $\mathsf{false} \to \mathit{whatever}$ must be $\mathsf{true}$ because $\mathsf{true}$ is how we cross out an operand to $\land$!
The word "implication" is all that remains to be justified, and the story for that is honestly a bit weaker than the story about why the truth table is what it is. The best I can offer is that (7) expresses the claim
$$ \text{if $p$ is prime then $p\mid a^p-a$} $$
using a $\to$ and a $\forall$ -- but both of these symbols are really involved in expressing the "if...then" meaning. They work as a team, not as unrelated players.
We could avoid having a $\to$ connective with a "weird" truth table at all, if instead of $\forall$ we had a combined construction
$$ \bigwedge_{p\in\mathbb N,~ p \text{ prime}} (p \mid a^p-p) $$
reminiscent of (1). But that's not how the convention in symbolic logic has ended up.
Duality.
The moral of the above story is that $\to$ is made to work together with $\forall$. It will yield very weird meanings if used in the combination $\exists x(\cdots \to \cdots)$. And indeed $\to$ is essentially never seen in that context in mathematics, other than in parlor tricks such as the Drinker's Paradox where the weirdness is exactly the point.
$$ \to \text{ goes with } \forall \\ \text{where} \\ \land \text{ goes with } \exists $$
How come the existing $\land$ worked to cross out disjuncts for $\exists$ but we needed to invent a new $\to$ symbol to cross out conjuncts for $\forall$?
One way to understand it is to look at the shape De Morgan duality takes in this perspective:
$$ \begin{align}
\neg\exists x: Q(x) \land P(x) &~\equiv~ \forall x: Q(x) \to \neg P(x) \\
\neg\forall x: Q(x) \to P(x) &~\equiv~ \exists x: Q(x) \land \neg P(x)
\end{align}$$
If we had just applied the ordinary De Morgan's laws blindly, we'd instead get
$$
\neg\exists x: Q(x) \land P(x) ~\equiv~ \forall x: \neg Q(x) \lor \neg P(x)
$$
which is certainly valid too, as far as it goes.
However, here we're viewing $Q(x)$ as a "guard" formula that tells us which values of $x$ we're interested in at all. It feels backwards that the negation of the formula would include speaking about $x$ that we're not interested in, so instead we'll often prefer a duality rule that lets $Q$ remain non-negated to the right of the $\equiv$. The values for $x$ we're interested in are still the same; we're just asking a different question about them. And that is exactly what $\forall x:Q(x)\to\neg P(x)$ achieves for us.