The Bell-Kochen-Specker theorem is one of the various no-go theorems against the existence of any "classical" theory capable to explain better the phenomenology of quantum mechanics and restoring realism and/or determinism.
These alternative theories are based on the assumption that a deeper explanation than QM exists. The deeper description is constructed out of a set of quantum hidden variables, usually denoted by $\lambda$, whose nature is unknown.
The considered theorem assumes certain quite general hypotheses on such theories, without entering into the details, and it proves that this class of theories cannot exist.
Note. The so called Kochen Specker (without Bell!) theorem was established after the one discussed here. The one discussed here can be found in one of the first papers by Bell (1966). It was already known to at least one of the other two authors. The later KS theorem has more or less the same statement, but it has a proof of much more elementary level, based on a direct and lengthy computation on a specific system of elementary Yes/No propositions. It is apparently independent of the Gleason theorem. The theoretical significance is however identical in my view.
The hypotheses of Bell-Kochen-Specker theorem are that, the hidden variable $\lambda$ defines a map associating each observable $A$ (any bounded selfadjoit operator in the Hilbert space of the system) with its value $v_\lambda(A)$ (a real number). This is the realism hypothesis: the hidden variable fixes the true values of all obvservables, including the incompatible ones!
The other explicit hypothesis is that, restricting ourselves to any pair of compatible observables $A$ and $A'$, the above map satisfies some functional requirement. Usually additivity
$$v_\lambda(A+A')= v_\lambda(A)+ v_\lambda(A')\quad \mbox{if $A$,$A'$ are compatible}$$
and multiplicativity.
$$v_\lambda(AA')= v_\lambda(A) v_\lambda(A')\quad \mbox{if $A$,$A'$ are compatible}$$
The thesis is that, if the Hilbert space has finite dimension >2, this map does not exist (as a topological consequence of the Gleason theorem firstly discovered by Bell) or it is the trivial one associating everything to $0$.
I stress that $\lambda$ has noting to do, at least directly, with any quantum state that can be defined on the physical system. In principle, a quantum state should correspond to some ensemble of values $\lambda$, i.e., a more approximate description. Quantum ramdomness should be explained in terms of classical randomness similary to statistical mechanics. However all those details are irrelevant in the theorem, and here is its powerfulness as a no-go theorem.
Coming back to the thesis of the theorem, a way out is that the map $v_\lambda$ is not a function only of the observable $A$ one measures, but it also depend on the other (compatible) observables one measures simultaneously with $A$.
$$v_\lambda(A| A_1, A_2, ....)$$
$A_1,A_2,...$ is the context of $A$. Each observable $A$ simultaneously has different values depending on its context when the hidden status $\lambda$ is given.
In principle, maps of this form are not forbidden by the BKS theorem.
From this perspective, the original maps that do not depend on the context are called non-contextual.
Therefore, the BKS theorem rules out hidden variable theories which are (a) realistic (b) non-contextual, and (3) they satisfy some natural functional relations only referring to pairs of compatible observables.
ADDENDUM Sketch of proof of BKS theorem. This is not the originary proof by Bell, but it similarly uses the continuity argument due to the Gleason theorem into a more straightforward way.
THEOREM Let ${\cal H}$ be a finite dimensional real or complex Hilbert space with dimension $>2$. Let $B_{sa}({\cal H})$ the real linear space of everywhere defined selfadjoint operators on ${\cal H}$. There are no maps $v: B_{sa}({\cal H}) \to \mathbb{R}$, different of the zero map, such that
(i) $v(A+B)= v(A)+v(B)$ if $AB=BA$,
(ii) $v(AB) = v(A)v(B)$ if $AB=BA$.
SKETCH OF PROOF
Notice that orthogonal projectors are selfadjoint operators $P:{\cal H}\to {\cal H}$ such that $PP=P$. We can restrict $v$ to the space (lattice) of orthogonal projectors).
From the hypotheses of additivity and multiplicativity, taking $PP=P$ into account, it is easy to conclude that (a) $v(P) \in \{0,1\}$ for every orthogonal projector $P$ and that (b) $v_\lambda(P_1+...+P_k)= v(P_1)+...+v(P_k)$ if $P_kP_h=0$ when $h\neq k$. Furthermore, $v(I)=1$ otherwise $v$ is the trivial map $v(P)=0$ for all orthogonal projectors. The spectral theorem would imply that $v(A)=0$ for every $A\in B_{sa}({\cal H})$ and this is not permitted.
$\dim{\cal H}>2$, (a), and (b) through the Gleason theorem (a part of the proof) imply that there exists a unique mixed state, $\rho$, such that $v(P) = tr (P\rho)$ for every orthogonal projector $P\in B_{sa}({\cal H})$.
Let us restrict this map to the set $S$ of the one-dimensional orthogonal projectors (that is the rays $p= |\psi\rangle \langle \psi|$).
$$S \ni |\psi\rangle \langle \psi| \mapsto \langle \psi, \rho_\lambda\psi \rangle \in \{0,1\}$$
This map -- viewed as a map to $\mathbb{R}$ -- is continuous trivially, $S$ is connected and thus the image must be connected as well. However $\{0,1\}$ is a disconnected subset of $\mathbb{R}$ whose connected components are $\{0\}$ and $\{1\}$. Hence either
$\langle \psi, \rho_\lambda\psi \rangle =0$ for all unit vectors $\psi \in {\cal H}$
or
$\langle \psi, \rho_\lambda\psi \rangle =1$ for all unit vectors $\psi \in {\cal H}$.
Notice that it must be $tr(\rho) =1$ since $\rho$ represents a mixed state. However, in the first case $tr(\rho) =0$, and in the second case (for $\dim({\cal H}) >2$) $tr(\rho) >1$. In both cases $tr(\rho) \neq 1$ as instead requested by the Gleason theorem. In summary, $\rho$ -- and thus $v$ -- does not exists. QED
For some further discussion see chapter 5 of this book of mine.