I just did a google search, and find several sites which confirm your statement that TANSTAAFL first appeared in The Moon is a Harsh Mistress, an old favorite of mine.
But I'm pretty sure I recall seeing it earlier in one of his short stories, which appeared in Amazing or The Magazine of Fantasy & Science Fiction. It's been fifty years or more since I read that story, so my memory is a bit vague.
I guess I last read it around 1972...