A lot of people want the full LDS experience, including the dating and marriage opportunities it offers.
Stanford brand is clearly better but actual education for undergrads is not necessarily always better. BYU may in some circumstances be better actual preparation for grad school — taught by a professor, not a grad student, often more opportunities for undergrad research, etc. There's a reason BYU is so good at grad school placement.