Why does Qatar Airways fly over Syria and Iraq?
They are trying to save themselves money, and their customers time.

First of all, why do the planes follow that route?  From your comments, you are going from Philly to Doha.

You might want to take a look at great circle routes to see why the planes are coming into Doha from that direction.  The Great Circle route depicted goes right through Syria and Iraq: it's the most efficient way to get there. Beyond that, Qatar has a few limitations that other airliners don't have, in that region, due to some diplomatic problems with their neighbors, who won't let them overfly their airspace: Saudi, Egyptian, and UAE airspace for the time being is closed to them.  (thanks @reirab)  

Diversions cost money

Some typical diversions in that region are well spelled out in this article in the Economist.  

What you may be seeing is that, for some flights that pass over the region, rather than landing within the region, they are accepting the risk that their airliners at 30,000+ feet might, maybe, get targeted on a really bad day (see the Malaysian Airlines flight shot down over the Ukraine a few years ago (MH 17)). But the odds of that are very low.  They most likely will not be disturbed.  (Or so a risk management case can be made).  A more conservative view of risk is offered here, in an Ops Group posting from September of 2018.  (Thanks to @ZachLipton for the link).  

Route diversions have very real fuel costs, and costs in time.


Image from the Economist, Oct 20, 2018 edition. 

The article mostly addressed flight into Lebanon by Middle Eastern carriers.  Flying into Beirut is of higher risk since the aircraft have to come down through the risky / war zone airspace for final landing, but it's instructive to illustrate how costs go up when more direct routing can't be taken due to safety precautions around conflict zones.  


  But for years the airspace over Syria has been crowded with warplanes. The Gulf airlines no longer use it. Instead Emirates, the flag carrier of Dubai, detours across Saudi Arabia and Egypt, adding 700 km to the trip.  The journey takes even longer on Qatar Airways, which was barred from Saudi airspace after a dispute between the Gulf countries erupted last year. Its route from Doha to Beirut resembles a crook: north over Iran, west across Turkey and south down the coast. What should be a 1,825km flight drags on for 2,865km. {snip}
  For travellers this is a nuisance, adding an extra hour or two to journeys. But for airlines it imposes real costs.  Qatar Airways posted a 766 million dollar  profit in the 2017 financial year.  In the 2018 financial year, it lost 69 Million dollars. Operating costs were up by 15%; passenger numbers were down 9%. “We didn’t raise the ticket price,” says Akbar al-Baker, the CEO. “We had to absorb the additional cost.”   
  
  Emirates and Etihad, the flag carrier of Abu Dhabi, run five daily flights to Beirut. With the detour around Syria, they log an extra 2.7m km every year. Depending on the aircraft, that means up to 19 million litres of additional jet fuel, about $11.4 million at current prices. {formatting changes by me to make this fit}  


@DavidRicherby points out, fairly, that this local problem is a bit different from the great circle route's need to make an adjustment, in terms of how much extra time and effort a given regional route costs, but it's useful as an illustration of how costs go up when these problems have to be dealt with.  

I don't want to have to worry about ...

Then don't.  What you worry about is under your control.  


How many airplanes has Qatar airways lost in the last seven years (the length of the Syria civil war) to being shot down? Zero.     
What does that say for your odds of this being a low probability
risk?

If you still worry, have you investigated one-flight life insurance?  I used to always buy that whenever I flew, through American Express, back in the 80's and 90's since I was just married and I had young kids.  I'd buy a million dollars worth for about 14 dollars each way.  If you are that worried, buy the life insurance.  It's about the same odds a winning the Lotto for your family.    


Full disclosure: I do not now work, nor have I ever worked, for Qatar Airways.