Du måste ge den en array så prova så här
$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);