  A celebrated theorem of Kleitman in extremal combinatorics states that a
collection of binary vectors in $\{0, 1\}^n$ with diameter $d$ has cardinality
at most that of a Hamming ball of radius $d/2$. In this paper, we give an
algebraic proof of Kleitman's Theorem, by carefully choosing a pseudo-adjacency
matrix for certain Hamming graphs, and applying the Cvetkovi\'c bound on
independence numbers. This method also allows us to prove several extensions
and generalizations of Kleitman's Theorem to other allowed distance sets, in
particular blocks of consecutive integers that do not necessarily grow linearly
with $n$. We also improve on a theorem of Alon about subsets of
$\mathbb{F}_{p}^{n}$ whose difference set does not intersect
$\left\{0,1\right\}^{n}$ nontrivially.
