Du skal give den et array, så prøv det sådan her
$sql = "SELECT user_id FROM tbl_users";
$users_profile_user_id = mysqli_query($con, $sql);
$fp = fopen("user_profile_id.csv", "w");
while ($row = mysqli_fetch_assoc($users_profile_user_id)) {
fputcsv($fp, $row);
}
fclose($fp);