Being confronted with a culture that is so very different from our own is pretty tough, I imagine.
In a big city like Istanbul - as opposed to the more rural areas, people probably have a very wrong image of what "westerners" are like. Sad as it is, this is not least due to how some tourists behave when on holiday.
That, of course, doesn't give anyone the right to generalise - I hate when people do that - but it seems to be a (bad) human habit and explains it.
Sorry you had to deal with this, hope you liked some of your stay, though, I have heard that Istanbul is a beautiful, impressive city.