The gypsy man struck Elie's father in order to demonstrate his supposed superiority over his prisoners.
I would like to point out that the gypsy is also a prisoner at Auschwitz. The Nazis would often use prisoners to guard other prisoners in the concentration camps during World War II. It seems like an odd system to have prisoners watching prisoners, but the system worked because men like the gypsy would enforce Nazi concentration camp order in hopes of receiving better treatment from the Nazis. The gypsy's immediate and extreme use of violence against Elie's father allows the gypsy to set a tone. Elie's father now knows not to mess with the gypsy, but everybody else that witnessed the event knows the exact same thing. Elie's father asked a simple question.
"Excuse me…Could you tell me where the toilets are located?"
The gypsy responded by striking Elie's father so hard that he crawled back into line. The gypsy made an example of Elie's father, and now the rest of the new prisoners know that he (and the other guards like him) are meant to be taken very seriously.