Why do textbooks often include the solutions to odd or even numbered problems but not both?
This allowance is a custom to allow instructors to give homework where the solutions to some questions were not provided directly to the student (at least not in the book - this was from a time where searching for solutions to homework was not so easy outside of personal social connections).
If an instructor just wants students to work on problems where the students can easily refer to sample solutions at the back of the book, the instructor can just assign "problems 1-7, odds only". If they want to assign only no-solution problems, they can assign "evens only". If they want to give a mixture to try to encourage students to mix up their solving strategies, they can assign both. To go farther, putting them at the back of the book was another way to try to make it take a little more effort to look for the solution, to encourage the students to try to solve it themselves rather than immediately looking at the solution.
Finally, it is a custom that the problems tend to go from easier to harder, with some texts making the highest numbered questions of a chapter require more knowledge or skills than is actually provided in the accompanying chapter.
As you can imagine, this isn't the only system of designing a textbook that would support these uses, but it just became a very popular and simple way to do it - so you can generally expect to see it in many of the textbooks you'll encounter.
If I were to produce such a book, my reasoning would be a bit different from that of BrianH. In using any such book for a course, I would probably assign only questions that did not have answers in the answer key.
But I would encourage the students to use a tried and true learning technique: reinforcement and feedback. The extra problems, while not assigned, give those students who want the practice (all of them do need it, actually) the opportunity to work on some additional problems and then check their work. If they got the correct answer they have additional confidence in their learning. If they did not, then they want to come and see me to find out where they went wrong - additional reinforcement and feedback.
I would, of course, stress that there is a good way and a bad way to use the answers. Working toward a known answer is far less valuable than working out an unknown answer. Not every student would 'get it' but the opportunity is there for them.
And, of course, they get reinforcement and feedback for the questions that I do assign and for those, I get to follow their thinking somewhat to search for misconceptions.
The other answers cover what I think is the main reason, but I want to bring up something else: Putting solutions into a textbook is a lot of work; the editors have to find the solutions, write them up, typeset them, and someone has to proofread them. On the other hand, the additional benefit of another solution becomes pretty small once half the problems have solutions, especially in those textbooks that feature a lot of rather repetitive problems.