Thanks for asking – great that you’re working to make sense of this!
Agreed that b = -2 and a = 4 is a valid answer to the question as stated, for the reasons you wrote.
Not sure why your book doesn’t include that, but sometimes in the overall instructions for the section’s problems the writer states to include only positive values. That’s a total guess, though.
And there is one subtlety perhaps worth mentioning: If the problem had written the first equation instead as
\log(a) = 2 \log(b),
then of course b could not be negative. But that’s not what they stated, and you are correct that the values you wrote are valid solutions to the equations given.
Fun thinking this through – thanks again for asking!