For the complete tutorial for the formula you can check Do Carmo's Differential Geometry of Curves & Surfaces page through 42-46 at section 1.7.
The formula $$\iint n(p,\theta)dpd\theta=2 Len(\alpha)$$ For finite length regular plane curve $\alpha$ and $n$ is count of intersection of lines with curve.
My question is:
I understand that to find global property we have to define some measure on lines in the real plane. What I don't understand is what does this integral actually mean?
Elaboration of my confusion:
In the proof for a curve with length $l$
So the integral(so called measure) $\iint dpd\theta$ is evaluated according to some generic line.
But if I want to calculate for, lets say circle with radii $r$, I calculate it as if $p$ and $\theta$ parametrize the circle. $2(Len(circ))=2(2\pi)=\iint \limits_{0\le p\le r,0\le \theta\le 2\pi}\underbrace{n}_{2}dpd\theta=2(2\pi)$
So what is we are actually doing?

You get $2(2\pi r)$ in both cases, of course. You are integrating over the region in the space $(p,\theta)$ of lines corresponding to lines that intersect the circle of radius $r$ centered at the origin. The lines with $p>r$ do not intersect the circle (so then $n=0$); the lines with $p=r$ intersect the circle once, tangentially (so then $n=1$); the lines with $p<r$ intersect the circle twice. So you get, indeed, $\int_0^{2\pi}\int_0^r 2\,dp\,d\theta = 2\pi(2r) = 2(2\pi r)$, which is twice the length of the curve.