I would definitely choose to study in Berlin over Barcelona. Barcelona is more of a holiday spot (in my opinion) but Berlin is such an amazing city, it's huge, lots to do and has so much history and culture to it. Plus the transport is amazing and everything's dead cheap.
Berlin is pretty awesome but freezing in the winter. What time of the year are you going? If you like clubbing, culture, music etc... go to Berlin. If you like warmth, a more picturesque place and a more Mediterranean, exotic feel, go to Barcelona.