Williams, who shot 13 for 21, scored 10 of Purdue’s last 18 points in the game’s final 4:45.
Michigan State (10-9, 4-9) reeled off six straight — Aaron Henry made a pair of free throws and jumper — and then Williams took control for Purdue.
Henry hit a 3 to reduce Michigan State’s deficit to 62-59 with 3:28 left but the Spartans never got closer.
Ivey scored 11 points for Purdue and Zach Edey 10.
The Spartans have dropped two straight and five of their last seven. Michigan State heads to Bloomington, Indiana to face the Hoosiers on Saturday.
Based on rankings as of today, Michigan State’s last five contests include matchups against No. 3 Michigan, No. 4 Ohio State and No. 5 Illinois.
Purdue faces Nebraska on the road on Saturday. The Boilermakers haven’t won consecutive games since Jan. 17 and Jan. 20.