The main reason is that balls are made out of materials that demonstrate elasticity. Elasticity is a physical property that allows an item to absorb energy by changing shape, and then release the energy by going back to the original configuration.
In the case of a dropped ball, you have to consider the fact that the entire ball does not hit the floor at once. The bottom of the ball hits the floor and stops, while the top surface of the ball is still descending. As a result, the ball's shape gets somewhat squashed as the ball impacts the floor. Elasticity allows the ball to return to its round shape; in doing so, it essentially pushes against the floor, and it comes back up in a rebound. The ball will never rise as high as the altitude it was dropped from because some of the energy is lost as heat, friction, and noise.