In your first sentence, "West Virginia University" is a proper name (proper noun phrase), while in the second sentence, the university is not specified. It is just a university (common noun) located in Virginia, and so it should not be capitalized.
The likely cause for your confusion is the fact that news headlines usually don't follow conventional grammar rules, and abbreviate titles, e.g. by leaving out articles.
As OP Costa points out in the comments, if the second headline was written in accordance with conventional grammar rules, and not headlinese (as pointed out in the comments by Kevin), it may have read something like this:
Students sued a Virginia university after a campus feminist group
member was killed.
18There's an implied article, of that helps: "Students sue [a] Virginia university" – ikegami – 2020-06-29T17:42:59.477
2And in my opinion it would be even better if it were written as “Students sue a Virginian university” with an n at the end. – gen-ℤ ready to perish – 2020-06-30T17:22:25.717
1Headline writers are known for sacrificing grammatical niceties for the sake of a shorter headline. – Lee Mosher – 2020-07-01T03:22:22.737
@gen-zreadytoperish: If you don't mind my asking -- where are you from? Personally, I'd find "a Virginian university" rather strange; "a Virginia university" is maybe a bit newspaper-y, but I think the regular-person version would be "a university in Virginia". [Google Ngram Viewer comparison] I'm American, FWIW.
– ruakh – 2020-07-01T21:21:24.577@ruakh Texas! We’re very proud of our demonym—Texan—and use it quite frequently. That’s why I’ve always found it weird that other states don’t use theirs. – gen-ℤ ready to perish – 2020-07-01T21:22:36.783
@gen-zreadytoperish: Good to know, thanks! Interestingly, Google Ngram Viewer doesn't find "a Texan university", either (only "a Texas university" and "a university in Texas"; [link]), but that might just mean that there isn't enough Texan writing in the Google corpus! :-)
– ruakh – 2020-07-01T21:27:13.2671@ruakh Yes, I’ve noticed English speakers aren’t as fond of demonyms as I am. I think I like them because I also speak Spanish. We have an adjective form of basically everything—even simple words, like beach. – gen-ℤ ready to perish – 2020-07-01T21:29:35.953