The midfielder scored in the 18th and 21st minutes to earn the Millers a first victory at Bolton for 21 years.
In a thrilling encounter watched by more than 20,000 fans, Wiles opened the scoring by smashing home a left-footed drive, his second goal of the season.
His third was a downward header from Dan Barlaser’s corner after Wanderers defender Ricardo Santos lost possession on the halfway line.
Striker Eoin Doyle hit the woodwork with Bolton’s best chance of the opening half, while home defender George Johnston’s header was disallowed for offside.
Rotherham brought on defender Wes Harding at half-time to combat the threat of Trotters top-scorer Oladapo Afolayan.
But it was the visitors who almost added a third goal when Michael Smith’s 55th-minute effort came back off a post.
Tempers grew heated on the touchline as the match wore on, with Bolton boss Ian Evatt and Rotherham assistant Richie Barker booked for a late flare-up.