That's because YouTube and similar websites will automatically recompress whatever you've uploaded. There is no work around. (despite what some websites will say)
Also, DON'T USE iMovie under an circumstances!!! It also recompresses your videos. There's a long story about how iMovie set back video recording several years by not working with higher quality encoding. It can't even handle AVCHD let alone XAVCS HD or real 4K.
Is there anyway to share high quality video online so all your friends and family can see what you shot? Not really. Other than burning your AVCHD or XAVCS video to a Blu Ray and mailing it to them.
4K video? Keep in mind they'll need a 4K TV to even play from a memory stick.
Sorry to sound so negative but this is one of the major problems with YouTube and iMovie. They don't like higher quality video.