There is a difference between flexibility and mobility.
Flexibility typically refers to the absolute range of motion a joint currently can achieve, whereas mobility refers to your ability to move a joint actively through a desired range of motion.
When it comes to strength training, the goal is to use full-ROM, have control, and stay pain-free during our lifts. This basically refers back to the concept of "mobility." You need to be mobile enough to properly execute the specific movements involved in your sport. This is why the degree of mobility you should have will depend on the type of sport you practice. As a simple example, the mobility needs of a gymnast will be different that of a hockey player.
If you currently are not mobile enough to perform the lifts you want to train, it's worth looking into a few tools that have been supported by the scientific literature to enhance mobility like: static stretching, dynamic stretching, and myofascial release through foam rolling.