Musíte tomu dát pole, takže to zkuste takto
$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);