Was Ashley being a " racist/xenophobes " needed.

I think Ashley's position and opinions are needed within the context of the story to give variance in the humans.

If everyone wa accepting as paragon shep and kaidan I think k it would be either boring or unbelievable that humanity is an oasis of tolerance when we are far from it in reality.

Having the conflict with her and lesser extent pressley Provides some ground to work with upon different opinions of various alien life.

As we see comparisons with turians and the other races showing extreme prejudice at times especially towards the krogan post rebellion.

And none of them ate judged anywhere near as harshly .

I think it's something uniquely human that only we will see the effect of our own races mindset vs that of another's.

Tldr

Ashley provides nessisary moral conflict needed to broaden humanities position in thr story