Indeed. But to become an EU citizen you have to meet the citizenship requirements, the common standard for which the UK has previously negotiated and agreed along with the other members, PLUS additional requirements and limitations can be imposed by the UK for other kinds of long term residential statuses. It's not like one member state is allowed really lax citizenship laws, so people can choose to sneak in through there, and restrictions can be imposed even by the UK for a limited period.
The UK manages to both have influence over EU immigration policies AND also have exemption to it for non-EU immigration, AND can apply its own limitations even for when immigrants get citizenship for a limited period. Yet many brexiters spout on about how the EU just dictates everything to us and it's all out of our control. Absolute rubbish.