You don’t need to leave a crazy amount of space when stopped at a traffic light, but you still should be leaving some. So if someone rear ends you, it minimizes the risk of your car then smashing into the person in front of you, so it reduces the risk of additional people being involved in an accident.
On the other hand if you’re in a real city and someone is already behind you, please pull up tight. That way someone else farther back can make a light or turn lane.