The EU's General Data Protection Regulation (GDPR), which still applies to the UK (and, indeed, is now embodied in our own Data Protection Act 2018 anyway), has been much criticised for many of its provisions but one positive thing about it is that it's made getting hold of personal data (that others hold about you) a lot cheaper.
Prior to GDPR, most organisations were entitled to charge a fee to provide you with a copy of any data they held on you. The maximum fee in most cases was £10 but there was an exemption for medical records, for which you could be charged up to £50. Under the GDPR provisions, all organisations are now obliged to provide you with such information entirely free of charge (except where a request is "manifestly unfounded or excessive").
So your GP was simply complying with his legal obligation.