To add to Namaste's answer above, two of the thing we're trying to teach in math is literacy and competency with the algorithms used to solve problems and the ability to solve problems for which you don't know the solution. The first is pretty well served by problems with solutions since you need to check your work. The second is the actual activity of doing mathematics, and is heavily informed by the first. And it's hard. But in order to do it, you need to practice doing it.
Basically, there's a whole list of skills that surround tackling an unknown problem:
- Identifying the problem as being solvable with a certain kind of mathematics.
- Planning out a logical series of steps and computations that will allow you to solve the problem.
- Following those steps carefully and adjusting them as you run into issues.
- Finally, analyzing the solution from a couple of different angles to know if you got something reasonable (The area under the curve is 4) or unreasonable (The area under the curve is -3).
All of these things take practice and confidence to do well. And they're hard, but just like playing guitar you can learn all the music theory and tabs you want but eventually you have to actually play. The fact that the doing is different skills is something you want to learn at home, not the first time you get on stage.
Mathematically, it is the difference between being able to do known analyses and being able to come up with a novel prediction mechanism, model, or formal description, use it to say something and be able to robustly describe your reasoning and back up the validity of your claims. To be clear, there's no reason to knock practical competency! A lot of engineering, computer modeling and practical statistics, uses known mathematics; the problems they deal with are interesting for different reasons and involve different kinds of novelty.
If you can follow your logic through an unknown exercise, check it three ways, and really understand your result, that is when you know a mathematical concept. Once you are comfortable with these steps, someone can hand you a novel problem and you can begin to reason through it.