Swimming is a sport that requires a massive amount of core stability.

Poor spine mobility or a lack of shoulder symmetry can be just two of the causes of discomfort in the shoulder and neck joints when swimming.
When you lift the arm out of the water in the front crawl stroke if you don’t have rotation in the thoracic spine the shoulder will suffer.

If your body is bending as you kick you are wasting valuable forward motion.
There are many land based exercises that will improve your swim speed, technique and reduce pain in the shoulders and back in order to have more fun.

Again a top to toe Biomechanics Assessment can find these before they become a problem.