This is easier to understand by looking at the mechanical power entering the system $P=\vec F \cdot \vec v$ where $\vec v$ is the velocity of the material of the system at the point of application of the force $\vec F$.
Let $\hat i$ be a unit vector pointing to the left. We will analyze only during the time that the crate is accelerating, $0<t<v_b/a=v_b \ m/F_k=v_b/(\mu_k \ g)$.
For the belt the velocity is $v_{b} \ \hat i$ and the kinetic friction force acting on the belt is $-F_{k} \ \hat i$. So the mechanical power is $P_b=-v_b \ F_k$. Since this is negative it means that mechanical power is leaving the belt at a rate of $P_b$.
For the crate the velocity is $v_c \ \hat i$ where $v_c = a t = t \ F_k/m = t \ \mu_k \ g$. On the crate the force is $F_k \ \hat i$ so the mechanical power is $P_c=v_c \ F_k = F_k \ a \ t $. Note that this is positive, meaning that mechanical power is entering the crate at a rate of $P_c$, and note further that that rate is not constant but it is increasing linearly over time.
So there is mechanical power leaving the belt at a constant rate and mechanical power entering the crate at a linearly increasing rate. Thus the total mechanical power is negative and goes to zero.
The negative total mechanical power is mechanical power that leaves the belt but does not enter the crate. That power goes to heat.
Why is the work done by the motor double of the difference in final and initial kinetic energies?
The work is the integral of the power, or the area under the curve in the plot. The difference in KE is the area of the triangle and the work done is the area of the rectangle. The triangle is half the area of the rectangle.
Friction is an internal force therefore it should not have any effect on the work done.
Whether it is internal or external is not relevant. The fact is that the total mechanical power is negative, so mechanical power is being converted to something else (heat).
Why and How (molecular mechanisms)does friction cause loss of energy as heat?
Heat isn’t defined at the molecular level. You need to have a very large number of molecules to even discuss heat.
is it just friction or do other forces like tension give the same result under similar conditions?
The same thing happens in many other contexts. Whenever you have one constant power and one linearly increasing power then you will have a factor of 2 conversion of energy from one form to another. Links have been provided in the comments.
what molecular interactions cause the loss of energy
The “loss” of energy is due to the fact that the molecules of the belt are moving at a different velocity than the molecules of the crate. So the equal and opposite forces produce different power.
specify whether or not friction causes a transfer of energy from belt to crate
Yes, friction causes a transfer of energy from belt to crate. The amount of mechanical power leaving the belt is greater than the amount of mechanical power entering the crate.
why exactly double of the energy gained by the crate is the required work done
The area of the rectangle is exactly double the area of the triangle.
if all forces behave this way or if it was just friction which remains unanswered
Friction is not unique in this regard. A common other one is charging a capacitor.