Only in the first game. He was the villain in the sequel, Donkey Kong Jr. Considering that the sequel still has a very clearly Donkey Kong-based title, and Mario is not the main character, it's safe to say that he's not the main character of the original Donkey Kong games; rather, he's just a major character in that series before he got his own series. Wario got his own series after starting in the Mario series.
What would you have called Mario before Mario Bros. was released? A Donkey Kong character. You would also call him Jumpman, but that's a different subject.
The point is, Mario wasn't always the star, and it wasn't always his series. He got his own series after being a major character in the Donkey Kong series, and his series is now considered its own separate thing. I see no reason why Wario, who was a major character in some Mario games before getting his own very distinct and separate series (two, in fact), would not be granted the same liberty of being considered the star of his own separate series, rather than an offshoot of another series (since Mario is generally not considered an offshoot of Donkey Kong).