I was reading Milne's ``Abelian Varieties'' notes this week and had almost this exact same question regarding the proof that Hom(A,B) is a free $\mathbb{Z}$-module. An internet search revealed this post and I felt that I have a thought to contribute. In particular, I believe that the proofs found in {Silverman 1, Milne, Mumford} that Hom(A,B) is a free $\mathbb{Z}$-module may be omiting a small and subtle but important step.

For instance, Sam Lichtenstein originally posted above that in Silverman's Arithmetic of Elliptic Curves, ``one then uses a little trick to deduce the $\mathbb{Z}$-finiteness of $M$ itself'', where $M$ is Hom(A,B). The little trick is quoted here for those who do not have Silverman in front of them:

Begin Silverman:

Since Hom($E_1$,$E_2$) is torsion-free, it follows that
$$\mbox{rank}_\mathbb{Z} \mbox{Hom}(E_1,E_2) = \mbox{rank}_{\mathbb{Z}_l} \mbox{Hom}(E_1,E_2)\otimes \mathbb{Z}_l,$$
in the sense that if one is finite, then they both are and they are equal.

End Silverman

My complaint is that the left-hand side does not make sense because we have not established much about Hom($E_1$,$E_2$). All we know is that Hom($E_1$,$E_2$) is torsion free abelian group. This does not seem sufficient to define $\mathbb{Z}$-rank. For example, what is the $\mathbb{Z}$-rank of $\mathbb{Q}$? Any two nonzero rational numbers are linearly dependent over $\mathbb{Z}$, and since $\mathbb{Q}$ is torsion-free we must conclude that $\mathbb{Q}$ has $\mathbb{Z}$-rank 1, so $\mathbb{Q} \simeq \mathbb{Z}$ (?!?!).

In Mumford, the proof that Hom(A,B) is a finitely generated free $\mathbb{Z}$-module appears to be the following progression of steps, each with its own detailed proof except for step 4:

Hom(A,B) is torsion-free

If $M$ is a finitely generated submodule of Hom(A,B), then $(M\otimes\mathbb{Q}) \cap \mbox{Hom}(A,B)$ is finitely generated.

$\mbox{Hom}(A,B) \otimes \mathbb{Z}_l$ is a free $\mathbb{Z}_l$-module for all $l \neq p$, where $p$ is the characteristic of the field

Steps 1-3 obviously now imply that Hom(A,B) is a free $\mathbb{Z}$-module

Step 4 is the step I was unable to follow at first. This is because step 2 holds the key to step 4 in a way that is somewhat subtle. For example, consider the torsion-free abelian group $N \subset \mathbb{Q}$ consisting of all rational numbers with denominators with $l$-adic valuation 0 or 1 for all primes $l$. That is, $N$ is the set of all $a/b$ where gcd$(a,b) = 1$ and the prime factorization of $b$ is $b = p_1p_2\cdots p_t$, $p_i \neq p_j$ for $i \neq j$. $N \otimes \mathbb{Z}_l$ is isomorphic to the principal fractional ideal $(1/l)\mathbb{Z}_l$. Since we only care about the $\mathbb{Z}_l$-module structure of $N \otimes \mathbb{Z}_l$, we see that $(1/l)\mathbb{Z}_l$ is a free $\mathbb{Z}_l$-module of rank 1, where the isomorphism $(1/l)\mathbb{Z}_l \rightarrow \mathbb{Z}_l$ is given by multiplication by $l$. $N$ is not finitely generated and thus would provide a counterexample if step 2 were not important because $N$ satisfies step 1 and 3. However, it fails step 2. If $M$ is a nonzero finitely generated submodule of $N$, then
$$(M \otimes \mathbb{Q}) \cap N = \mathbb{Q} \cap N = N$$
and $N$ is not finitely generated. Mumford pays lipservice to the use of step 2 to prove step 4, but he does not fully explain.

What I think is missing is something like the following proposition: ``If $N \subseteq \mathbb{Q}$ is a subgroup satisfying axiom 2, then $N$ is finitely generated''. Prove this by contradiction similar to the previous paragraph. Let $M \subseteq N$ be a finitely-generated submodule and observe that $M \otimes \mathbb{Q} = \mathbb{Q}$, hence $M$ is finitely generated if and only if $N$ is finitely generated.