How to prevent my connected axles from falling apart?
You can attach couple of half bushes or full bushes on inner side of the axle near Technic beam like on the other side you have done with a gear. If axle is still trying to slide - fill in the entire inner axle part with bushes.

 

Here is picture of suggested fix. Here you can see extra half bushes added to fix the axle the same way gear fix the other axle from moving outwards.