Why the photon doesn't acquire mass with the Higgs mechanism? I did the computation that from 
$$(0,v)^{T}(\partial_\mu+igA_\mu^a\tau^a+i\frac{g'}{2}B_\mu)(\partial_\mu-igA_\mu^b\tau^b-i\frac{g'}{2}B_\mu)(0,v)$$ 
with $(0,v)$ being the expectation value of the Higgs field and $\tau, B_\mu$ being the generator of the SU(2) and U(1) group proves the mass term for the $Z_\mu$ and $W^\pm_\mu$ and not for the photon. That said if I rewrite the covariant derivative  in terms of the $Z_\mu, W^\pm_\mu$ and $A_\mu$ ($c_1,c_2$ being the constant dependent on $e,\theta_\omega$ for brevity):
$$D_\mu=\partial_\mu-c_1[W_\mu^+(\tau^1+i\tau^2)+W_\mu^+(\tau^1-i\tau^2)]-c_2Z_\mu(\tau^3-\sin^2{\theta_\omega}Q)-ieQA_\mu$$
I don't realize how the term in $A_\mu^2$ doesn't give a mass term for the photon. Any hint is well appreciated.
 A: The short answer is for you to see what the charge operator in your 2×2 matrix notation is when acting on the Higgs doublet, whose upper component is +, and lower component is neutral: of course, the v.e.v. must be chargeless! This is by dint of the hypercharge 1 of the (entire) Higgs doublet. 
Thus, sandwiching the charge matrix squared  between the Higgs v.e.v.s (o,v)  annihilates Q2 and thereby  any feared photon mass term.  
More explicitly, ignore the plain derivative, since it collapses on the constant v.e.v., and omit the $W^{\pm}$ in the covariant completion, since they amount to terms orthogonal to the photon and Z in the square. 
The remnant is the diagonal part of the derivative-completion-squared 2×2 matrix acting on a Higgs doublet, just 
$$
g^2v^2 ~~(0,1) \operatorname{diag}(^3A_\mu +\tan^2\theta_W ~B_\mu, -^3A_\mu +\tan^2\theta_W ~B_\mu  )^2 ~ (0 , 1)^T  \\ 
\equiv \frac{g^2 v^2 }{\cos^2 \theta } (0,1)  \operatorname{diag} (A_\mu ^2, Z_\mu^2) ~(0,1)^T =  \frac{g^2 v^2 }{\cos^2 \theta } Z_\mu^2, 
$$
the calculation you said you had no trouble with.
The very same calculation in the physical (propagating) basis involves
$$
Q=\operatorname{diag} (1,0), \\  \tau^3 - \sin^2\! \theta_W ~Q= \cos^2\! \theta_W \tau^3 -\sin^2\!\theta_W ~ Y/2\\  = 
\operatorname{diag}\!(1/2 -\sin^2\! \theta_W   ,-1/2 ).
$$ 
Acting on the v.e.v., Q vanishes, decoupling $A_\mu$ from the uncharged vacuum, as already indicated; while the eigenvalue of the neutral current charge is just -1/2, to be squared to multiply your $c_2^2$, namely $4e^2/(\sin 2\theta_W)^2$, to yield the above mass.
