Yes, it matters. The quality of education is better. Lower ranked schools don't dole out the same kind of punishingly hard material that higher ranked schools do. The content of the degree is meaningfully different (based on my experience doing undergrad in a well ranked school and going back to mess around in part time classes while working.)