> Is it because global variables are can not be optimized well? Is it because of bugs in Julia related to global variables?
Mainly this; it's incredibly easy to accidentally use global variables and swamp your whole program. Think about defining some constant "n" in the global space and forgetting to put "const" in front of it. Then any for loops that use "for i = 1:n" will reallocate n on every iteration. If it's a nested loop, you'll get huge accidental memory allocations (this particular problem [not mine] is one on Stack Overflow that took a while to debug).
It's the same reason garbage collection is used; it's not strictly necessary but it prevents a lot of accidental bugs and makes programs easier to reason about. I think it would be the same with removing global variables.
* Of course, you still want function names to be global, so perhaps define a namespace that you can dump immutable functions or constants into. Or if there's good reasons not to remove global variables, at least make them all const by default and add a "mutable" keyword (and maybe swap that in the REPL). This would at least remove most of the accidental bugs.