The bacterial cell wall is quite porous, and is not considered a permeability barrier for most small molecules. It mainly functions as structural support and to resist turgor pressures.
The average pore size of relaxed peptidoglycans were measured to have a radius in a range of about 2.0 to 2.5 nm, regardless of thickness (i.e. Gram + and Gram - bacteria have similar pore sizes), but when stretched under turgor pressures, peptiglycan is permeable to globular proteins of 50 kDa or more, while hyperosmitic shock of bacterial cells can trigger the release of proteins up to 100 kDa in size (Vollmer et al., 2008). That equates to ~6.5 to 8.5 nm in diameter by one method of estimation.
A single strand of DNA double helix is around 2 nm in diameter, so it stands to reason that even a circularized plasmid could potentially pass through pores just a little more than 4 nm wide.
Reference:
Vollmer, W., Blanot, D., & De Pedro, M. A. (2008). Peptidoglycan structure and architecture. FEMS microbiology reviews, 32(2), 149-167.