When Christ was pierced with the spear, why did water come out? On the cross, when the Romans pierced Christ with the spear, the scriptures say that water poured out: 


  But one of the soldiers with a spear pierced his side, and forthwith
  came there out blood and water. (John 19:34)


The Greek word used is ὕδωρ (hydōr) so it's unlikely that they meant, "fluids" or anything else, it's apparent that it was literally water that came out. 

Why did water come out of Christ when he was speared?
The probable medical reason is pleural efflusion, caused by hypovolemic shock and congestive heart  failure. 

Hypovolemic shock, also called hemorrhagic shock, is a life-threatening condition that results when you lose more than 20 percent (one-fifth) of your body’s blood or fluid supply. 

This would likely have been a result of the flogging prior to the crucifixion.

From gotquestions.org:


  Those who were flogged would often go into hypovolemic shock, a term
  that refers to low blood volume. In other words, the person would have
  lost so much blood he would go into shock.


...


  Prior to death, the sustained rapid heartbeat caused by hypovolemic
  shock also causes fluid to gather in the sack around the heart and
  around the lungs. This gathering of fluid in the membrane around the
  heart is called pericardial effusion, and the fluid gathering around
  the lungs is called pleural effusion. This explains why, after Jesus
  died and a Roman soldier thrust a spear through Jesus’ side (probably
  His right side, piercing both the lungs and the heart), blood and
  water came from His side just as John recorded in his Gospel (John
  19:34).