I don't keep a public blog anymore because of AI scrapers, but when I did, I did it because I enjoy writing essays and sharing knowledge, and I enjoy even more when people read and find them and find them valuable. The same is true for a lot of the software and other projects I do.
It's like any other hobby. You do it because you get value out of doing it. Making money is irrelevant. Actually, I take that back... making money would reduce the value of doing it because as soon as your goal is to make money, you're immediately constrained in terms of what you can do and how you can do it.