Mesh A changes after joining it to mesh B
I too dont understand why the smoothing is happening. But you can fix it by clicking in the flat option, and flat shading should be applied to the whole object again. Maybe someone else can explain what is happening.