The reason why the Battle of Berlin was so bloody was due to several factors. First, the German Army was fighting in excellent defensive terrain. Cities allow defending forces a great deal of cover, concealment, and protection from the enemy forces. Further, they can launch attacks at their leisure from a number of unexpected angles, including sewer drains, basements, 2nd/3rd/etc. story windows, or roofs. Anti-Tank crews can move up to within lethal range and launch a deadly attack, and even civilians can contribute by throwing grenades or Molotov Cocktails. The urban environment is an extremely challenging battlespace because an attack could come from literally anywhere, and by the time defenders open up, they are already at lethal range.
Second, the German defense of Berlin bordered on the fanatical. The core of the defense was made up of the last battle hardened forces available to Nazi Germany. SS troopers and eastern front veterans which were augmented by old men, children, and women who feared what the monstrous Red Army would do to the city if they captured it. These units forced the Red Army to fight for every street, every avenue, and every major building. This kind of grinding and attritional warfare took its toll on the attackers.
Finally though, it is important to remember that the defenders suffered nearly as many casualties as the attacker. The Soviets were methodical and relentless in their efforts to root the German Army out of every defensive position they established. The Soviets wanted to take the city, and quickly. They let nothing stand in their way of achieving that victory, and killed tens of thousands of German soldiers and civilians in their effort.