You have to give the $new value to the buffer after each str_replace, or you will only get the last censuration at the end
while ($censure = mysql_fetch_assoc($mots_interdits)):
$new = str_replace($censure['mot'], $censure['mot2'], $buffer);
$buffer = $new
endwhile;