Why do we put transistors in logic gates?
A transistor is a lot like a voltage-controlled switch.
You have something that's pretty much a NOT gate. One unusual thing about your NOT gate is that it involves a pushbutton—a human-controlled switch. And that's totally fine! But if we wanted to build a computer out of logic gates like that, then we'd need to replace the human-controlled switch with a voltage-controlled switch. That's where transistors come in.