Use un alias y ordene por para la secuencia de conteo correcta
$interests = "SELECT name, COUNT(*) AS my_count
FROM pageinterests
WHERE pageid = '$id'
GROUP BY name HAVING COUNT(*) > 1
ORDER BY my_count";
.......
for($x = 1; $x <= $rim; $x++){
$rat = mysqli_fetch_assoc($interestresults);
echo "<tr>
<td>".$rat['name']."</td>
<td>".$rat['my_count']."</td>
</tr>";
}