The short answer is: yes, your undergrad matters for med school. While it does play a role in admissions, however, it's neither the most nor the least significant factor.