Soccer is a fairly injury prone sport. It's great that people are playing sports, but I've seen studies suggesting that it's the most injury producing of team sports, beyond even tackle football. Looking at Australia, here are some metrics being reported:
The rate of injury for football players is up to 35 injuries per 1,000
That's more than 1 injury per 30 hours of playing. Obviously a lot depends on what you refer to as an "injury", but either way the sport you're playing is notoriously hard on the body.
A good strength training program would take you far though. While it may not stop your injuries, strength training will lessen the amount, make them less severe, and give you a better route through recovery.
Resistance training in addition to increasing muscular strength and
hypertrophy may also aid in the prevention of injuries. Research
indicates that resistance training promotes growth and/or increases in
the strength of ligaments, tendons, tendon to bone and ligament to
bone junction strength, joint cartilage and the connective tissue
sheaths within muscle. Studies involving humans and animal models also
demonstrate resistance training can cause increased bone mineral
content and therefore may aid in prevention of skeletal injuries.
Investigations to date suggest resistance training can aid in injury
I'd recommend a basic program like Starting Strength or Strong Lifts 5x5. Since you're paricularly having problems with your hamstrings, I'd supplement with a couple of exercises in particular:
Single leg Romanian deadlift. It's a big name for a relatively simple exercise, but I bet the first time you try it you'll topple over. Running and soccer are particularly single-leg sports: one is on the ground while the other is in the air.
Good mornings. Do these after you've spent a few weeks doing one of the linked barbell training programs above. Initially, they will give you a wicked case of DOMS, so keep the weight lighter than you can possibly imagine: even an unweighted Olympic bar (20kg/45lbs) will be plenty. These are one of the more difficult exercises to perform, so buddy up with a professional trainer (maybe who can squat 2x their body weight), and have them check your form.