Infinite square well: wall with infinitesimal thickness Given an infinite square well, it doesn't matter how thick the wall is, the particle is trapped inside the two walls. If we make the wall of arbitrarily small but finite thickness, the particle is still trapped inside the wall, i.e. it is not possible to find the particle outside of the potential well:

However, if we take a limit of the thickness of the wall to zero, the potential effectively becomes a double Dirac delta distribution. And for this scenario, the derivative of the wavefunction will be discontinuous at the two points of infinite potential:

What is the qualitative difference between finite and infinitesimal thickness of the wall that results in whether the particle is trapped within the walls or leak outside of the walls?
 A: Well, one has to be precise when discussing an infinitely tall & infinitesimal thick wall. The order of limits matters. E.g.


*

*If the wall is modelled as $$V(x)~=~\left\{\begin{array}{ccc} \infty &{\rm for}& x~=~0\cr\cr 0 &{\rm for}& x~\neq~0\end{array}\right\}~=~\lim_{\varepsilon\to 0^{+}}V_{\varepsilon}(x),\tag{1a}$$
where 
$$V_{\varepsilon}(x)~=~\frac{1}{\varepsilon}\delta_{x,0},\tag{1b}$$
and where $\delta_{x,0}$ is the Kronecker delta, then the potential is zero almost everywhere:
$$V(x)~=~0\text{ a.e.}\tag{1c}$$ Therefore the Lebesgue measure (and the particle) can not detect the wall in the first place. In other words, there effectively is no wall.

*If the wall is modelled by the Dirac delta distribution
$$V(x)~=~A \delta(x),\qquad 0<A<\infty,\tag{2a}$$ which is a distribution/generalized function, then $$V(x)~=~\lim_{\varepsilon\to 0^{+}}V_{\varepsilon}(x)\tag{2b}$$ is a limit of a finite rectangular wall 
$$V_{\varepsilon}(x)~=~\frac{A}{\varepsilon} \theta(|x|\!-\!\varepsilon/2),\tag{2c}$$ with height $\frac{A}{\varepsilon}$ and thickness $\varepsilon$, i.e. with a fixed area $A$. Here $\theta$ is the Heaviside step function. Then quantum tunnelling through the wall is possible.

*If the infinitesimal thick wall 
$$V(x)~=~\lim_{\varepsilon\to 0^{+}}V_{\varepsilon}(x)\tag{3a}$$ is a limit of an infinitely tall wall 
$$V_{\varepsilon}(x)~=~\left\{\begin{array}{ccc} \infty &{\rm for}& |x|~<~\varepsilon/2,\cr\cr 0 &{\rm for}& |x|~>~\varepsilon/2,\end{array}\right. \tag{3b}$$  then there is no quantum tunnelling. 
A: To elaborate on Qmechanic's answer, and on Leo L. comment :
Are they different kinds of "infinity" at =0?
Yes, there are different kinds of infinity for a potential, and different kinds of zero width.
It all comes down to taking a rectangular potential wall of small thickness $\epsilon$  and of large value $V(\epsilon)$ within the thickness, zero potential outside.
Then you take the limit for $\epsilon$ goes to zero.
I haven't yet told you what  $V(\epsilon)$ is, except that is goes to infinity when $\epsilon$ goes to zero.
If I choose, for instance $$V(\epsilon) \propto 1/\epsilon^2$$
so the product $\epsilon V(\epsilon)\propto 1/\epsilon$ goes to infinity when $\epsilon$ goes to zero, this is Qmechanic's third case.
The infinite of the  potential is "stronger" than the "zero" of the width.
There will be no quantum tunneling.
This will also be the case for  $V(\epsilon) \propto 1/\epsilon^3$, $V(\epsilon) \propto 1/\epsilon^4$, etc.  or even $V(\epsilon) \propto 1/\epsilon^{3/2}$, $V(\epsilon) \propto 1/\epsilon^{4/3}$, etc.
Contrariwise, I choose, for instance $$V(\epsilon) \propto 1/\epsilon^{1/2}$$
so the product $\epsilon V(\epsilon)\propto \epsilon^{1/2}$ goes to zero when $\epsilon$ goes to zero,
or $V(\epsilon) \propto 1/\epsilon^{1/3}$, $V(\epsilon) \propto 1/\epsilon^{1/4}$ or even $V(\epsilon) \propto 1/\epsilon^{2/3}$, $V(\epsilon) \propto 1/\epsilon^{3/4}$, then we are in Qmechanic's first case : the particle does not "see" the infinite potential, because this infinite is "weaker" than the zero value of the width.  It will behave as a free particle, despite the infinite potential.
Finally if $$V(\epsilon)= A/\epsilon$$ so that the product $\epsilon V(\epsilon)$ is the constant $A$, this is Qmechanic's second case, quantum tunneling is present.
So it really boils down to the fact that there are different infinities....
