I was told (when I had to get one to provide medical evidence to my uni as to why I missed a uni and deserve compensated marks as a result) by my local GPs it depends on the letter required, and if there is a charge it is because of the reasons for the letter (IIRC an employer letter was free but it was about 3 months ago)
I think the other reason was to discourage the workshy from trying to get free time off work
Mine was a retrospective note, funnily enough he wouldn't write me one before my operation.....