There are two reasons why people behave like this:
1) Genuine ignorance and a complete lack of concern for their future
or
2) As a defensive psychological mechanism.
No one likes being told they are stupid. No one does. No one also likes to be told that they are ignorant either. So, in order to cope, they pretend that they fail on purpose, or that they don't try. If they try and fail, they will be called idiots. If they pretend that they don't try or don't care, they hope to convince others that they aren't stupid, but lazy.
I saw this all the time - usually this sort of behavior starts at a young age. When a child in most western schools fails at a task, some teachers give up on them, or refuse to help them. They get called names, they get scolded by their parents, they feel miserable that they failed. So, they convince themselves that
1) They don't need an education and
2) They never really tried in the first place.
It's a way to justify their bad scores to themselves. If they're bad at science, they'll turn around and say "who cares about science!?". If they're bad at math, they'll turn it around and say "who needs maths?" If they generally fail across the board, one of the only ways to cope, to salvage their pride, is to say "why care, why bother!". It's Nietzsche's slave morality at work - they want to do well, but they can't, so they turn around and mock those who do well.
Then again, there are those who are just plain ignorant or foolish. When I was in high school, there were about 10 guys in my class who wanted to play rugby at a professional level. They were actually pretty nice guys, they weren't stupid, but they believed that they had what it took to "take it to the next level". Statistically speaking, the odds of ANY of them, let along all of them, making it big in rugby were next to nil, but that didn't stop them neglecting their studies.
I think you'll find that if you actually talked to these people, you'd realize that it's all just an act. An attempt at bravado - to show that bad scores don't affect them, that they're rebellious, that they're a free spirit. It's a foolish, pointless, damaging act, but teenage minds aren't exactly logical, and this is the only way they feel they can cope. Most of them know, deep down, that they're in trouble if they don't do well, but they don't want to think about it.
Many of these people might be willfully ignorant, but they aren't stupid, and to be honest, a lot of the blame for their condition can be placed squarely at the feet of teachers and fellow students, as well as parents. Teachers who give up on students or who downright insult students, are bad teachers. Fellow students who smirk at people for failing are also bad students. Parents who spend no time helping their children, or who constantly attack their children, are bad parents. And all of these things contributes to a bad student.
I was lucky. My parents invested an enormous amount of time in educating me, and I had a few very, very good teachers. My parents always told me that as long as I tried, I really had nothing to be ashamed of. Luckily for me, my best effort was pretty good. I got good grades - not the best in class, but pretty high up there. My parents attention, combined with two really good science teachers, has led me down a path which I am comfortable with. I'm halfway to completing my Master of Molecular Biology degree.
I think most students could get better. True, there are some students who are born with..... less talent at maths or science, but that doesn't mean they shouldn't be encouraged to be the best the CAN be. Not everyone can be Einstein. I'm certainly no genius, by any standard. Yet I got quite far in my academic pursuits, and it was due to the fact that I was ENCOURAGED.
It really does make a difference.