Do graduate schools consider courses that are exclusive for one country? In Norway, it is mandatory to do a course in philosophy named Examen Philosophicum. I got a B in this subject, and as such, it hurts my GPA. Do graduate schools (in mathematics) care the least bit about such subjects?
This depends on the nature of the subject and the program to which you are applying. Anything that's "on-topic" for your field would of course be considered—so if you're doing a graduate program in something like philosophy, theology, history, or something in that part of the "spectrum," such a course probably would be considered. However, if you're studying something in, for instance, the sciences or engineering, or something in the humanities far removed from this—such as music—such a course would probably receive much less consideration.

Moreover, a grade of B in such a course is almost certainly not going to make a significant enough difference in your GPA that you would have been admitted if you had gotten an "A," but will be rejected because you got a "B."