The reason it needs to be logged in is because Google Colab is a free service that Google provides allowing people to run code on expensive GPU servers. It doesn't cost you anything and I don't store any information from your google account when you run it.