For a purely algebraic derivation, consider the general form of the Möbius transformation $\,T(z)=\dfrac{az+b}{cz+d}\,$. Both $\,a\,$ and $\,c\,$ cannot be $\,0\,$, otherwise it would be a constant transformation. The right half-plane is invariant to the inversion $\,T(z) \to \dfrac{1}{T(z)}\,$ so it can be assumed WLOG that $\,a \ne 0\,$, then after normalizing it can be assumed WLOG that $\,a=1\,$. The condition $\,T(0)=3\,$ translates to $\,b = 3d\,$, so in the end $\,T(z)=\dfrac{z+3d}{cz+d}\,$ for some $\,c, d \in \Bbb C\,$ with $\,d \ne 0\,$.
The unit circle must transform into the imaginary axis, so for $\,|z|=1\,$:
$$
\begin{align}
0 = 2 \operatorname{Re}\left(T(z)\right) &= \dfrac{z+3d}{cz+d} + \dfrac{\bar z+3 \bar d}{\bar c \bar z+ \bar d} \\
&= \frac{(z+3d)(\bar c \bar z + \bar d)+(\bar z + 3 \bar d)(cz + d)}{|cz+d|^2} \\
&= \frac{(c+\bar c)|z|^2+ 6 |d|^2+(\bar d + 3c\bar d) z+(3 \bar cd +d)\bar z}{|cz+d|^2} \\
&= \frac{2 \operatorname{Re}(c)+ 6 |d|^2+(3c+1)\bar d z+(3 \bar c +1)d\bar z}{|cz+d|^2}
\end{align}
$$
It follows that $\,3c+1=0\,$ for the numerator to not depend on $\,z\,$, and $\,2 \operatorname{Re}(c)+ 6 |d|^2=0\,$ for the numerator to be $\,0\,$. The first equation gives $\,c = -\dfrac{1}{3}\,$, and the second one $\,|d|=\dfrac{1}{3}\,$. Therefore, defining $\,\omega = 3d\,$ the general solution is:
$$
T(z) \;=\; \frac{z + 3d}{-\dfrac{1}{3}z+d} \;=\; 3\,\dfrac{z + \omega}{-z + \omega} \quad\quad\style{font-family:inherit}{\text{where}}\;\; |\omega|=1
$$
[
EDIT ] For quick verification of the form above:
$$\small
\frac{1}{3}T(z) = \dfrac{z + \omega}{-z + \omega} \color{red}{\cdot \frac{\bar \omega}{\bar \omega}} = \frac{1+\bar \omega z}{1 - \bar \omega z} \color{red}{\cdot \frac{1 - \omega \bar z}{1 - \omega \bar z}} = \frac{1 - |\omega|^2|z|^2+\bar \omega z - \omega \bar z }{|1 - \bar \omega z|^2} = \frac{1 - |z|^2+ 2i \operatorname{Im}(\bar \omega z)}{|1 - \bar \omega z|^2}
$$
Therefore $\,\small\operatorname{Re}(T(z)) = 3\,\dfrac{1 - |z|^2}{|1 - \bar \omega z|^2} \ge 0\,$ iff $\,\small|z| \le 1\,$, and of course $\,\small T(0) = 3\,$.