Pfffff before I translated идти к школе as "... going to the school" and it was marked as wrong because it said it needed to be "to school" without the "the". Now I translate this sentece as "... going to school" and it is marked wrong, it says it should be "to THE school". What the heck? It's just so frustrating.
K is towards, in the direction of and it takes dative case. B is in(to), inside, to (as in inside) and it takes accusative. к школе would mean towards the school (we are going to meet someone in front of the school so we are going towards the school. people are walking towards the school/ went in the direction of the school). в школу is to school in literal or educational sense, regardless of the way there. The problem is they can both be translated with to school, but they don't mean the same thing.
к школе should be translated as "to the school," and в школу as "to school." English is weird that way. The article actually indicates the reason one is going. Without the article, it is for a class. With the article, it is for some other reason -- a game, a meeting, practice, etc.
We have the same with "to church" versus "to the church." Without "the," we are going for a religious service. With the article, it is for some other reason -- choir practice, Boy Scout meeting, etc.
Try reading the rest of the comments here before posting questions which have already been answered. Two years ago - a year before your post - Gwenci replies to an identical question:
"Unfortunately, the rule of adding ‘о’ doesn’t apply to all consonant clusters. Wiktionary mentions вс- , вт-, мн-, сн-, but there are more: св-, вз-… and I can’t think of other examples. Шк-, however, is definitely not one of them."
"People walking toward(s) school" was wrong, why? "People walking" is directly equivalent (semantically and grammatically) to "people are walking" and "toward(s) ..." should not require a definite article! There are so few instances where adding "the" would make a difference.