Why is aniline less basic than methylamine? The reason given for the question is that in aniline the lone pair on N atom is delocalized throughout the benzene ring, making it less available for donation.

But the conjugate acid of aniline should be more stable given the fact that the positive charge on N atom is also delocalized throughout the ring, hence making it more stable than the conjugate acid of methylamine which has +I effect. On that account, shouldn't aniline be more basic?
N in aniline is forced into an $\ce{sp^2}$ configuration because only then can its p orbital interact to form aromatic MO’s. By contrast, methylamine has its N in the usual $\ce{sp^3}$ configuration. An $\ce{sp^2}$ lone pair has a great contribution from an s AO than an $\ce{sp^3}$ lone pair (33% vs 25%), and because an s AO is lower in energy than a p AO (due to a region of electronic density closer to the nucleus), it is also lower in energy. Therefore, the HOMO of aniline has a poorer energy match with the H 1s LUMO than the HOMO of methylamine, and the resonance energy stabilizing the protonated adduct is smaller. Hence, aniline is less basic.