First, as you noticed, it is enough to consider the case that the equation has the form $$w^n+a_{n-1}(z)w^{n-1}+\ldots+a_0(z)=0,$$ where the coefficients are entire. Then $w$ is holomorphic on its Riemann surface, let us call this Riemann surface $S$. From your condition follows that $S$ is a compact Riemann surface with finitely many punctures. So it can be represented by an algebraic curve $K$ in $C^2$ given as a zero set of a polynomial $F(z,u)=0$. Suppose that this curve is non-singular. Let $m=\deg_u F$. We have an analytic function $w$ on $K$, so it can be extended to the whole $C^2$, So $w$ is a restriction of $K$ of an entire function $G(z,u)$. Now on $K$ we have $$G(z,u)=\sum_{k,j}a_{k,j}z^ku^j=\sum_{j=0}^{m-1} u^j\sum_{k,i=0}^\infty a_{k,j+im}z^k=\sum_{j=0}^{m-1}b_j(z)u^j,$$ where the rearrangement of the infinite sum is legitimate because of the absolute convergence. This proves your statement as $u$ is algebraic over $C(z)$.
It may happen that every realization of $S$ in $C^2$ is singular. In this case we realize $S$ in as as a non-singular curve $K$ in $C^n$ (I suppose one can take $n=3$ but this is irrelevant.) Let the coordinates in $C^n$ be $(z,u_1,\ldots,u_{n-1})$. Then $w$ can be represented by an entire function $G(z,u_1,\ldots,u_n)$ and the restrictions on $K$ of the coordinate functions $u_1,\ldots,u_{n-1}$ are algebraic functions of $z$, and by the theorem on the primitive element, they are all rational functions of $z$ and some $\beta$, where $\beta$ is an algebraic function of $z$. Then the same argument works.