Hmmm. Interesting one. As you say, perfectly legal. I've known people who never fly without a passenger who isnt paying a share, to the extent that they are quite often meeting the pax for the first time at the club !
Personally, the times I took friends as a pax I never asked for any money (other than the day membership they had to pay), as I wanted to fly, and didnt mind having a friend.
I suppose it comes down to how much you ask them for. If i was a ppl and cost sharing I certainly would ask for less than the % (i.e. less than 50% for 1 pax).
As you say, if they dont want to pay, they dont fly. Yes you are building hours, but you are also enjoying the flying. They are also enjoying the flight, arguably more so as they never have done it !!