> I could, in theory, write a license that says, basically, you can't distribute my source code, but you can look at it, compile it, and even alter it to fit your needs.
You can, but this doesn't meet the Open Source Definition, so you might be infringing on their trademark if you were to call that an Open Source License.
The Open Source Definition[1] has defined the term "open source" since the late 1990s to mean exactly this.
The term "Open" refers to open-membership (for contributions), and not transparency.
[1]: https://en.wikipedia.org/wiki/The_Open_Source_Definition
> I could, in theory, write a license that says, basically, you can't distribute my source code, but you can look at it, compile it, and even alter it to fit your needs.
You can, but this doesn't meet the Open Source Definition, so you might be infringing on their trademark if you were to call that an Open Source License.