Many religions (such as Buddhism or certain kinds of Christianity) and the whole New Age spirituality are based on or include the idea that the whole purpose of your life in this world is to allow your soul an opportunity for growth. Everything that happens to you, from abuse as a child to the death of your wife, are nothing but learning tasks.
You could employ a variant of this philosophy in your story.
On the other hand, many tales, both traditional (epics, folk tales) and modern (novels, movies, tv series), focus more on the effects of an experience than its ultimate cause. This is the basic principle behind what Hitchcock called the MacGuffin: some stories offer some pretense of a reason, but ultimately it does not matter why Sauron wanted to rule Middle Earth or why the murders were committed on the Orient Express – what the story is about is Poirot solving the riddle or how Frodo fights the power of the Ring.
So if you feel the need, you could make up some reason for the curse, but you can also have it remain a mystery – and bring attention to the fact that we often don't understand the reasons why things happen to us in real life.
If you want to find a reason or cause to the effect you have, ...
begin with the purpose of the effect:
How will the curse affect your protagonist? What obstactles – inner and outer – will he have to face? How will this change him? What goal will he achieve in the end? What will it mean for him and the world he lives in?
find the opposite to that purpose – that's your cause:
If the protagonist has to overcome some weakness, then the reason for the curse is that weakness. If the protagonist has to kill the dragon, then the dragon (or what- or whoever created or called the dragon) is the cause of the curse.
But it seems to me that you already have your cause. You write: "The witch's motives are to force a character building experience on the protagonist."
If you want to go further than that, then you are asking why a witch would want to build the character of some random person, to which there are a variety of possible answers:
- the witch is a mentor and the protagonist is the predicted savior of their people
- the witch is under a curse herself, and she curses the protagonist to equip him to free her of her own curse
- the witch is the personification of some principle (such as the seasons or the rule of the land) and the curse forces the protagonist to overcome (and possiblly replace) her (to rejuvenate the crops or their land)
- the protagonist has to learn something that can only be grasped by not knowing that it is "merely" learning (e.g. you have to be mortally afraid to learn how to deal with being mortally afraid, and if you are told it is just a class on dealing with fear, you will not be mortally afraid)
- etc. p. p.