Why is the number of subgroups of a finite group G of order a fixed p-power congruent to 1 modulo p?

I agree with Derek's remark, that is a very neat way to prove it. Another way to prove it is the following and it learns you more about counting principles in $p$-groups. I assume that you have proved Exercise 1C.8 of Isaacs' book that says that you can reduce the problem to $p$-groups.

Lemma 1. Let $H$ be a proper subgroup of a finite $p$-group $G$ and suppose $|H|=p^b$. Then the number of subgroups of order $p^{b+1}$ which contain $H$, is congruent 1 mod $p$.

Proof. Fix a subgroup $H$ of order $p^b$ of the $p$-group $G$. Since $H$ is normal and proper in $N_G(H)$, one can find a subgroup $K$ with $|K:H|=p$ (look at the center of $N_G(H)/H$, which is non-trivial, pick an element of order $p$, say $\overline{x}$ and put $K=\langle x \rangle$).
On the other hand, if $K$ is a subgroup of $G$ with $H \subset K$ and $|K:H|=p$, then $H \lhd K$ (because $p$ is the smallest prime dividing $|K|$), and hence $K \subseteq N_G(H)$.
We conclude that |{$K \leq G: H \subset K$ and $|K:H|=p$}| = |{$\overline{K} \leq N_G(H)/H: |\overline{K}|=p$}|. The lemma now follows from the fact that in the group $N_G(H)/H$ the number of subgroups of order $p$ is congruent to $1$ mod $p$ (in any group, which order is divisible by the prime $p$, this is true and follows easily from the McKay proof of Cauchy’s Theorem). $\square$


Lemma 2. The number of subgroups of order $p^{b-1}$ of a $p$-group $G$ of order $p^b$ is congruent 1 mod $p$.

Proof. Let $G$ be a non-trivial group of order $p^b$. Let $\mathcal{S}$ be the set of all subgroups of $G$ of order $p^{b-1}$. Observe that this set is non-empty and fix an $H \in \mathcal{S}$. We are going to do some counting on the set $\mathcal{S}$, by defining an equivalence relation $\sim$ as follows: $K\sim L$ iff $H \cap K=H \cap L$ for $K, L \in \mathcal{S}$.
Observe that for $K, L \in \mathcal{S}$ with $K \neq L$, $G=KL$, $K \cap L \lhd G$ and $|K \cap L|=p^{b-2}$. It is easy to see that the equivalence class $[H]$ is a singleton. In addition, $H=K$ iff $H \in [K]$ for $K\in \mathcal{S}$.
Now fix a $K \in \mathcal{S}$, $K \neq H$. Counting orders one can see that if $L \in \mathcal{S}$, then $H \cap K\subset L$ iff $L \in [K]$. Hence the number of elements in $[K]$ is exactly the number of subgroups of order $p^{b-1}$ containing $H \cap K$, minus 1, namely $H$. Owing to the previous lemma, we conclude that $|[K]| \equiv 0$ mod $p$. The lemma now follows. $\square$.

Using these two lemma's you now can prove the statement by cleverly counting the number of subgroup pairs $H$ and $K$ of $G$ having order $p^b$ and $p^{b+1}$ respectively. Now back to your original question

Theorem. Let $G$ be a group of order $p^a$, $p$ prime. Let $0 \leq b \leq a$ and $n_b=$|{$H \leq G: |H|=p^b$}|. Then $n_b \equiv 1$ mod $p$.

Proof. Let $H$, $K \leq G$, with $|H|=p^b$ and $|K|=p^{b+1}$. Define a function $f$ as follows: $f(H,K)=1$ if $H \subset K$ and $f(H,K)=0$ otherwise. Let us compute $\sum_{H} \sum_{K} f(H,K)$ in two different ways: $\sum_{H}$$\sum_{K} f(H,K) = \sum_{H} \sum_{H \subset K}1$ $\equiv \sum_{H} 1$ mod $p$, according to Lemma 1 above. Similarly, by reversing the order of summation of $H$ and $K$, the sum equals $\sum_{K} 1$ mod $p$, using Lemma 2. In other words, for all $b$, the number of subgroups of $G$ of order $p^b$ is congruent mod $p$ to the number of subgroups of $G$ of order $p^{b+1}$. The theorem now follows from the fact that the number of subgroups of order $p^a$ equals 1, namely $G$ itself. $\square$.

Remark. The theorem counts all subgroups of fixed order $p^b$. If we restrict ourselves to the normal subgroups of order $p^b$ the same holds: |{$H \unlhd G: |H|=p^b$}|$\equiv 1$ mod $p$. Sketch of proof: let $G$ act by conjugation on the set of all subgroups $H$ of order ${p^b}$. The fixed point are exactly the normal subgroups. Now apply the Theorem above.

Finally, also see this StackExchange entry.