why solar rooftop panels are tilted?

The panels are tilted because the earth has a tilted axis towards the sun. So the solar panels have to be tilted accordingly to bring out the maximum efficiency from the light coming from the sun to your solar panels.