How important are GRE analytical writing scores for graduate admission in STEM fields?
Poor GRE scores are a warning sign, not a stop sign, in most graduate admissions. Essentially, the GRE is only a weak predictor of ability to do graduate-level research, and therefore doesn't get all that much weight, at least in the STEM fields.
Now, that said, you don't want to have a 1 out of 6, either. But there are often mitigating factors with respect to the writing section. Given that you have questions like this one:

Some people believe that government funding of the arts is necessary to ensure that the arts can flourish and be available to all people. Others believe that government funding of the arts threatens the integrity of the arts.
Write a response in which you discuss which view more closely aligns with your own position and explain your reasoning for the position you take. In developing and supporting your position, you should address both of the views presented.

I would argue that the writing section is a test that reveals more about the capabilities of students in the humanities than it does students in STEM fields. So do the best that you can, and don't worry too much about this writing sample.
It's much more important to worry about the research statement you send to graduate schools!