It should have been made clear that the first line is an identity, which means that it holds for every value of $x:$ $$32x+32-8ax-4a-2a+2bx+b\equiv0.\tag0$$
As every real value satisfies this equation, its LHS polynomial has more than one root, so, by the Fundamental Theorem of Algebra, it cannot be a degree-one polynomial, so it must be the zero polynomial, so all its coefficients are $0,$ giving equations $(1)$ and $(2).$ (A fuller explanation is here.)
Alternatively: differentiating the identity gives equation $(1);$ substituting in $x=0$ gives equation $(2);$ substituting in $x=1$ gives $$64-14a+3b=0;\tag3$$ solving any two of $(1), (2)$ and $(3)$ gives the required solution set.