The reason your expectations of kinetic energy loss are violated is because you picked a non-inertial reference frame.
In fact, you didn't notice, but based on your assumptions, momentum isn't even conserved.
Let's look more closely at your first equation:
$$m_e * 0 + m_i v_i = m_e * 0 + m_f v_f$$
Let's say the ball's mass is 5 kg. If the ball is falling down towards the ground, the initial velocity before the collision should be negative (assuming we have adopted a coordinate system where "up" is positive). Let's say the ball was moving at 10 m/s. Here is our equation so far:
$$m_e * 0 + (5 kg) (-10 m/s) = m_e * 0 + (5 kg) v_f$$
Let's simplify, given your assumption that the Earth doesn't move:
$$(5 kg) (-10 m/s) = (5 kg) v_f$$
Which gives us
$$ v_f = -10 m/s $$
Whaaa? The final velocity is negative? That means . . . after this "collision", the ball is still falling downward at the same speed! If we assume, as you did, that the velocity was positive, then the momentum of the system can't be conserved! Clearly, something is wrong here.
Here's the trouble: You began in the reference frame of the Earth. Once the ball hit the Earth, the Earth's reference frame is no longer inertial! You either have to introduce a fictitious force on the ball to account for the fact that the Earth accelerated (a tiny bit, yes, but an important tiny bit), or you need to find an inertial reference frame.
So, Let's pick the frame of reference in which the Earth starts out at rest. When the Earth moves, we'll let our frame of reference stay where it is, so as to allow it to remain inertial:
$$m_e * 0 + (5 kg) (-10 m/s) = m_e * v_{e, f} + (5 kg) v_f$$
$$-50 kg m/s = m_e * v_{e, f} + (5 kg) v_f$$
NOW we can introduce a coefficient of elasticity and demand that energy be either conserved or not, and find the final velocity of the Earth and the ball as they rebound from each other.
Note that although $v_{e, f}$ will be incredibly tiny, due to the enormous mass of the Earth $m_e$, the final momentum of the Earth will be non-negligible - in fact, the final momentum of the Earth must be comparable to the final momentum of the ball in order for momentum to be conserved!
So, to sum up: You picked a non-inertial reference frame, and didn't account for it, so your reliance on the laws of physics was betrayed.
It seems you tacitly set a colinear collision, if not let me know to modify the answer.
The spring will compress in a variety of modes.
-If the collision is elastic, the moving block will stop entirely after it hits the stationary block and give all its momentum (Newtons system of balls and cradle ) to stationary block and then that stationary block starts to move back with speed v and this will compress the spring and start to push the last block back. This will start a free vibration in the system of the spring and two blocks which will gradually slide away while vibrating.
-If the collusion is not elastic there will be some loss of kinetic energy of the moving block and it may recoil back while pushing the second block back and compressing the spring, or depending on the stiffness and length of spring it may become one with the two blocks and move and with them at least for the compression part of the vibration.
Best Answer
Remember that an inelastic collision means energy is lost but not momentum. Momentum is always conserved in collisions. So you have to figure out what kind of velocity the two joint masses have and use your knowledge of springs to compute the halt at the given position, velocity and mass.