Many gyms, especially commercial, only have resistance machines instead of free weights. Health and safety is always the explanation for this as it is said that free weights are unsafe.
There are no Health and safety regulations which would prevent someone lifting free weights in a gym. The gym has a right to set its own policy on the provision and use of fixed weights, which may be linked to levels of supervision and the need to ensure people know how to use the equipment properly. However, it should state its reasons clearly.
This is a clear case of “health and safety” being used as an easy catch all excuse rather than explaining the reasons for their policy.