I see no problem with publishing LaTeX source codes for books and more-or-less stable versions of lecture notes. However, I often feel that what I have written is not mature enough, and it seems that there is not much point in publishing the source code if you are not completely satisfied with the current version.

I agree with you generally though. In fact I started releasing source codes for homework problem statements since some students like to type their homework solutions in LaTeX and having the statements' source code would save them some time.