I guess blaming people for their own troubles is a basic human need, along with water, food, sleep, etc. I am not sure where it comes from - probably the wish to distance oneself from the trouble ("the victim has done something unwise, and I won't, therefore it won't happen to me") or take some control over it ("I have done something wrong and shit happened, and I won't do it again and shit won't happen ever again").
Doubtless a lot of people get in trouble after doing a lot of unwise things. Nevertheless some shit just happens without anyone doing anything unwise. More to the point, we tend to judge the risk and wisdom of the actions by the final result.
Decent people tend to suppress the impulse to blame the victim unless either a) the victim's stupidity was somewhere in the Darwin Awards class and the victim is nowhere within hearing range, or b) the blame is in fact constructive, as in telling a person who spends all his/her time at home and bemoans the absence of a sex partner that they should visit some venue where the potential sex partners congregate.
Some people, and some cultures as well, still haven't got the idea. My family keeps yelling at me and each other every time we get a common cold, which is fairly often. My way of dealing with it is not telling them unless it happens when I see them in person; their idea is that the common cold should be avoided by wearing a lot of clothes and avoiding the people who have it, although the former is useless and the latter impossible.
Another interesting case is blaming the woman for going to a man's place and getting raped there. It's very common in Russia, less common in the US and even less in Finland unless the man belonged to some ethnicity overrepresented in rape statistics, but it does exist. The funny thing is in all the three cultures visiting a man at night is considered a fairly normal thing to do if no rape has occurred (well, varies a bit by subculture). By some coincidence I have met many men (and women, but for them I don't have a point of comparison) who blamed women for coming to a man's place and getting raped, but I have never met a man who'd warn me against visiting his place, or inviting him to mine, or showing a slightest surprise or shock at my unwise actions. None of them ever tried anything ungentlemanly, either, unless you count the guy who wanted to talk about Catholicism instead of sex.
Anyway, these thoughts came to me after a recent rape case in Russia: a well-known artist and a friend of his allegedly raped - she has injuries and a witness a 17-year-old student and a whole bunch of people are saying "why did she go to his place, didn't she know what was gonna happen?" I am not sure they are helping his case in court, even in Russia.
The really surreal moment came when during that discussion somebody mentioned a soldier who got raped and maimed by two women, and the reaction was pretty much the same: "what was he thinking, didn't he know what was gonna happen?" Right. Because I am sure young women perform aggravated rape and aggravated battery on careless soldiers all the time.
My other particular favorite is the people who blame the victims of unpredictable natural disasters for being or living there when the disaster happened.