I am currently an undergraduate student. I noticed that regardless of
what courses I'm taking, there are always a handful of people who view
everything as a huge competition. That is, they would do anything
possible (other than committing academic offenses) to ensure that the
final grade they receive is higher than everyone else's. They create a
rather hostile environment.
Unless you're enrolled someplace like ancient Sparta, if this behavior is causing problems ("rather hostile atmosphere" sounds like it is), you might report it to their teachers or other appropriate people at your college. If they're not sympathetic to your concerns, you might consider another college.
However, I always thought that Academia is about advancing knowledge,
which means we need to help each other, not put each other down.
I'd say that's a good principle. All such principles are just single perspectives, though. Real people and situations can be seen usefully from a variety of (often contrasting or even contradictory) perspectives.
I am still young, but I have been thinking of pursue an academic
career. So my question is, are there any reasons for this competitive
behaviour?
Good question. Each situation is different. Perhaps it could be interesting and useful to discern what's happening in the cases around you. Various possibilities have been suggested in answers here. Could be the academic structure (grading curves, limited slots) or the ideas (and sicknesses) your culture, school, teachers, or maybe just certain students have.
You might also consider whether it's really a problem worth worrying about. People who think that "life" or "the world" are about competition, tend to express ideas designed to convince (themselves and) others, and this can suck others into needless concerns or arguments.
A perspective that can be useful is "what we resist, persists"; it may be best just to ignore or avoid such people. I'd hope that (outside Sparta) just being a good student will still be effective, regardless of their competitive antics.
Is this just an undergraduate problem that will go away when I enter
graduate school?
It could go away by going to a school or class that isn't like that. Few I've known would I call "extremely hostile"! Some graduate programs may be like that, but you can try to detect and avoid those. Subject can also tend to correlate to a difference (e.g. law school, business school, and limited (enrolment/grant) programs, versus humanities or less-overly-popular subjects).
Or am I just way too naive of how the world really works?
No. Even if one were to adopt a selfish competitive philosophy (which I don't recommend), it would still be foolish (even in Sparta, or a sports program) to treat small-scale tasks as competitions and to fixate on beating everyone else and so create a hostile environment. That's undermining one's own learning environment, and to me indicates sickness.