In French, we have an idiomatic expression to say that something was done for no reason. For instance, if a guy passes by and insults or spits on someone in the street for no reason, we would say "c'est gratuit" (literally "it's free"). It means "wow, that was for no reason" or "wow, he didn't ask for it".
I was told Spanish people say "por la cara" (literally "by the face") in this situation.
Is there an idiomatic expression in English to express that?
EDIT: I understand most of the answers, but I feel like there is something missing. I had forgotten it in my question, but when we say that in French, there is also the idea that the poor guy didn't deserve it. He asked for nothing, and this happens. It is not actually for every situation where there is "no reason" to do something.