Why would Air France fly to Algeria when it had a civil war?
A civil war yes, but it still had a government and this was supported by France.
A flag carrier like Air France does not really have all that much leeway in terms of what they can do and it was probably in the nation's interest to show support to the legal government. Since they had asked, the answer was probably yes they had to fly(but no politician worth his salt would be on record as stating that! Without an airlink to the outside world a lot of things would come to a halt. I would imagine a lot of people who were trying to assist in finding a conclusion (mediators) would be users of the flight. There would also be a steady stream of people leaving the country and AF may be one of the few options available.
Most airlines treat flights into danger-area differently and where unions are strong having volunteers to operate the flight may be an acceptable solution to both the airline and the union.