Actually, you can spell it "genre" as well.
Things like when the words were brought into the language, which part of society adopted them, how commonly used they are, and just how foreign their sounds are to us can all be factors.
For many loan words, like "sjanger/genre", there are two accepted spelling variants. Sometimes the Norwegian version catches on, and sometimes it doesn't. With new English loan words, it's more difficult to "make" people adopt the Norwegian alternatives, as they're already familiar with the English.
For French loan words, which are generally older, it was likely more down to snobbery. French and Latin was brought in by the upper class, and using those words in their original form would set them apart from the people who would have no clue how to spell or pronounce them.