First, you should understand what "conservation" means in a physics sense. Conservation of a quantity means it is neither created nor destroyed in a time-limited process (we're not talking about eternity past or future). It is merely moved around to other systems/objects or (for energy) changes forms. The means that if a quantity (like momentum or total energy or total charge) in a system changes, then some of the quantity is added or removed in the system. Conservation includes the possible "flow" of the quantity in or out. If there is a totally isolated system, then conservation implies constancy. If the quantity is not constant, the means the system is not isolated.
In your question, you have inferred that the system of the two objects is isolated. That means total linear momentum, total energy, total angular momentum, and total charge (all of which are always conserved) should be constant. Obviously, the momentum of $m$ changes (conserved but not constant) and the momentum of $M$ changes, but the total momentum of the two objects, if they constitute an isolated system, remains constant:
$$\vec{p}_{after}=\vec{p}_{before}+\vec{J}_{external},$$
where $\vec{J}_{external}$ is the transfer of momentum (impulse) due to external forces (gravity, friction, etc). Since impulse is zero, the momentum remains constant.
Next, the total energy of the system is conserved, and should be constant if you discount any sound waves created by the collision, but you have looked only at the kinetic energy of the system. There is no conservation law for kinetic energy!
There are special types of collisions in which the total kinetic energy of the objects is constant, and those collisions are called perfectly elastic collisions. That is a special case and NOT a general conservation law. Unfortunately, the term "conservation of kinetic energy" has sneaked into the lexicon, but it is a misnomer.
So, finally, what happened to the kinetic energy in your collision. If two objects stick together, there must be some type of permanent deformation of interacting surfaces (or some change in field potential energy if charges or magnets are involved). Much like a spring getting compressed and never releasing, the potential energy has increased permanently if the objects are stuck together. Also, some of the kinetic energy shows up as an increase in internal energy (hit a nail with a hammer several times an notice the temperature increase of both objects). Finally, sound waves transfer energy out of the system.