Will getting a B in math [linear algebra at a college] as a prospective math major hurt my chances at top schools?

You’ll never know why you don’t get in …if you don’t. So many perfect kids are now ‘in shock’ because they didn’t get in somewhere.

Btw there are great schools, not as hard to get into, that are tops in the fields you are looking - big publics but well thought of - Arizona, Colorado, UCSC (likely too late).

Go for where you want of course but these are not necessarily leading schools.

And no matter where you apply, make sure you can afford to go.

One never knows how admissions will play out unless they apply.

So do so - and know you can get to the same place ftom most any school. Sure it may be a bit harder but don’t put all your eggs in the ‘dream school’ basket. A dream school doesn’t exist. They all have warts.

Good luck.