It's just whatever society decides is offensive. Right now, culturally, sex is something of a taboo subject, and as such vulgar sexual words are usually offensive.
Hundreds of years ago, sex wasn't so taboo, and religious epithets were the main offensive language, such as "damn" or "God" or whatever, which is why you have ways around them from back then, like "Zounds" which means "God's wounds." Any time you see the weird Z in old stuff like that that sounds very old fashioned and a little silly now, it's usually a stand in for "God" in order to get away from how offensive it was to take the Lord's name in vain when they came about. Zounds is the only one I can really think of that's survived this long.
However, if you go back and read old stories from the 1300s or whenever, you'll find that they use the word "cunt" (or "cunte" or "coynte" or any of the other spellings they used then) a lot just in passing like it's nothing at all. Same with a lot of our offensive language, at least with the older words.
I'll elaborate a bit on Barrie's point, which is correct, if disappointing.
The problem is that English spelling was not designed for Modern English. It was designed for Middle English, a very different language. When Middle English changed its pronunciation to become Modern English, English spelling did not change. Furthermore, English borrowed many thousands of words from other languages, which were of course pronounced differently, and spelled differently still.
The result is that one has to choose between two strategies in learning English words, however they are spelled -- this is not a problem confined to the letter I -- or else figure out some way to mix them.
Either you can actually learn the historical rules about pronunciation and learn to distinguish the different kinds of word each rule applies to -- which amounts to learning some basic linguistics,
Or you can do as Barrie suggested, and memorize 2 things about every word you learn -- (1) how it's spelled and (2) how it's pronounced (Kenyon and Knott is your friend here) -- and just ignore the possible but treacherous correspondences you might suspect between Middle English or foreign spellings and Modern English pronunciations.
The second option amounts to giving up all hope of making sense of English spelling. Most native English speakers do this, which is simpler for them, since they already know the pronunciation.
Since Anglophone education systems don't teach anything about English language, they never learn any different, and many still believe there should be a simple rule for pronouncing every letter.
Best Answer
It is, unfortunately, an important aspect of the English language, and there is, unfortunately, no hard-and-fast rule on the subject. We need stress to differentiate between words like "record" (the noun) and "record" (the verb). Improper stress will also make you sound absolutely ridiculous to the average native English speaker. Depending on the severity of your pronunciation transgressions, some native speakers won't be able to understand you at all.
My suggestion would be to imitate what you hear to the best of your ability. Stress is an important part of English words, just as tone is an important part of Chinese words. It may be difficult to learn pronunciations for all words, but it is a necessity.