After that I never saw bugs in my room again
Why do you think you never saw bugs again?
I stopped leaving crumbs everywhere in my room.
It's good that you stopped leaving crumbs around, because doing that does attract bugs. It's a bad idea to do things that attract bugs because they can be dirty and people don't like seeing bugs around.
I'm not sure what role bugs have, but you are right that I shouldn't do things that attract them.
Exactly. Bugs create an unsanitary condition in your home and leaving out food that they can get to make things worse. Clean up when you are done eating and keep your home spic and span.