What are classifying spaces actually classifying? Let $G$ be a group. When we say the classifying space of $G$ we are actually meaning the classifying space of the principal $G-$bundles because the notion of classifying spaces is about classifying the principal $G-$bundles and not about classifying groups. Is my understanding correct? 

If $G$ is a topological group, $BG$ classifies principal $G$-bundles. More precisely, for any paracompact topological space $X$, there is a natural bijection between $[X, BG]$, the set of homotopy classes of maps $X\to BG$, and $\operatorname{Prin}_G(X)$, the set of isomorphism classes of principal $G$-bundles. 
There is a principal $G$-bundle $EG \to BG$ which is called the universal principal $G$-bundle (see here for more about the construction of the bundle). The natural bijection is
\begin{align*}
[X, BG] &\to \operatorname{Prin}_G(X)\\
[f] &\mapsto f^*EG.
\end{align*}

Note, the topology on $G$ matters. With the usual topology on $O(n)$, $BO(n) = \operatorname{Gr}_n(\mathbb{R}^{\infty})$ which has infinitely many non-zero homotopy groups, but if $O(n)$ is equipped with the discrete topology, the classifying space is a $K(O(n), 1)$ and therefore has only one non-zero homotopy group.
