Why is Kaer Morhen in such a bad shape?
I did not play Witcher 1+2 and didn't read any of the books, so my reference pool is Witcher 3 only.
When I came to Kaer Morhen I was quite surprised to see that it is in such a bad shape. Most of the peripheral buildings in the surrounding are in ruins and the castle itself is in a state of disrepair. There appear to be only 3 witchers left who still live there and they seem to be no longer interested in training new recruits (in fact, the biography of Lambert mentions that he is the last one who was trained in Kaer Morhen).
What is the story reason why the Witcher caste is in such a decline and in which game/book did this happen? It certainly can not be lack of demand for their services: During his travels Gerald got jumped by customers left and right (or is that a case of gameplay-and-story-segregation and there are in fact less monsters at the time witcher 3 takes place than there used to?).
Most of the destruction in Kaer Morhen is due to lack of hands to work. Note that there are only 4 witchers from this castle left, and there is simply not enough hands to provide better care for their home. It's slowly falling apart, as many things do due to time passing by. Also you might have a false impression with customers jumping from left and right - it's made in the game for you to enjoy it. In the books, as far as I remember, the monsters that Geralt was contracted for were more "elite". Most of "low-level" monsters were hunted by mere humans, without a risk of killing someone during mutations.
Also, if you do not want any spoilers, Witcher 1 contains story in Kaer Morhen (it's the prologue) where it gets heavily destroyed (with later references in Witcher 3 to this moment). If you do not care about spoilers:
Most of the walls were destroyed during Frightener fight when a group called Salamander stormed in to steal the mutagens. Some stairs also collapsed when Geralt was escaping a group of Salamanders.
Considering your hidden question about not training new witchers there - the witcher proffesion, as mentioned by other answers was a dying one. Also the losses of children not surviving the mutations were so high that the risk just wasn't worth it. If you've played Witcher 3 to the end, you would know
that Vesemir promised himself never to use the mutation tools again, as the side effects created by potions and mutagens were too brutal to cope with.
Kaer Morhen was attacked by the neighboring villages many years before. This theme (of Witchers being distrusted and "unnecessary") is explored throughout the game
If I remember correctly, ideas that the Witchers are not required due to the falling demand for their services are also shown.
I do not believe the actual attack on Kaer Morhen is shown in any of the books or games (may be wrong), however there are some logs of the time of the attack itself during the first set of Wolf School gear scavenger quests.