Protonating/basic site and Brønsted basicity orders of beta, gamma, and delta lactams
As the significance of the two contrasting factors cannot be easily evaluated, let us first look at some evidence. Wan, Modro &amp; Yates (1980) reported the $\ce {pK_a}$ values of the conjugate acids of the various lactams, as shown in the table below:

\begin{array}{|c|c|c|c|} \hline
\text{Lactam} &amp; pK_a\\ \hline
\ce{$\beta$, 4} &amp;  -0.96\\ \hline
\ce{$\gamma$, 5} &amp; -0.65 \\ \hline
\ce{$\delta$, 6} &amp; -0.18 \\ \hline
\ce{$\epsilon$, 7} &amp; -0.46 \\ \hline
\ce{$8$} &amp; -0.38 \\ \hline
\ce{$9$} &amp; -0.18 \\ \hline
\end{array}

As the ring size increases, from the 4-membered $\beta$-lactam ring to the 9-membered ring, the basicity of the lactam increases. This seems to suggest that the oxygen atom may indeed be the protonating site for these lactams, even for those with the smaller ring sizes. However, it seems that the 6-membered $\delta$-lactam ring exhibits rather anomalous basicity. 

The authors explain the general trend in basicity as follows, using the two resonance structures shown:




  If the two canonical forms of the $\ce {O}$-protonated lactam are considered, the basicity will depend strongly on the ability of nitrogen to donate its pair of electrons
  to give a delocalized cation. Hence structure II will be more important in the conjugate acid than the analogous contributing structure in the neutral lactam. This will cause more serious ring strain the smaller the size of the lactam ring, and hence tend
  to reduce the basicity. As the rings become very large, such strain factors will become less important and the basicity would be expected to level off at a pK value similar to that of a typical secondary amide. Only the 6-lactam is unusual in that its base strength is much higher than expected. It is commonly observed (27) that for five-membered rings exo double bonds are preferred, while for six-membered rings endo double bonds are more stable, although these preferences are not easily rationalized. Therefore contributions from canonical form II in the protonated 6-lactam should be more important than in the $\gamma$-lactam case (and possibly the other lactams as well), leading to a higher basicity for the 6-lactam than its ring size would lead one to expect from the trends in Fig. 2.


Reference

Wan, P.; Madro, T. A. ; Yates, K. The kinetics and mechanism of acid catalysed hydrolysis of lactams. Can. J. Chem. 1980, 58, p. 2423-2432.