Because how Ruby works: when you divide an integer by an integer, you get an integer. In this case, it will be 0, because it is the integer part of the result.
To get the result of a float, just tell Ruby that you really need a float! There are many ways to do this, I think the easiest would be to simply convert one of the operands to Float ...
puts counts["email"]/total.to_f