I think you and BerkTech are talking about same problem:
"As Rabolisk has pointed out, momentum is not conserved when there is a net force acting on the system. As he also stated, this concept is built into Newton's second law. Basically, if a force is acting on an object (or system), then the object (or system) is experiencing an acceleration, which means it's velocity is changing. If the linear velocity changes for an object of constant mass, then the linear momentum changes. (The linear part is not the key part here, but for the system in question it will help).
Once the moving block collides with the stationary block resting against the spring, the two blocks will move together against the resistive force of the spring. That means there is a force acting on the two-block system (namely the restoring force of the spring). That force is against the motion of the blocks, so the blocks will slow down, and thereby lose velocity (and momentum). Momentum was not conserved after collision, because of the spring force acting on the system (F = -kx). "