Ваш код практически не читается.
Вот вам решение:
<?php
$usa = [
['Los-Angeles', 'Californiy', 3792621],
['San-Diego', 'Californiy', 1307402],
['San-Xose', 'Californiy', 945942],
['Dallas', 'Texas', 1197816],
['San-Antonio', 'Texas', 1327407],
['Xiqston', 'Texas', 2100263],
['Feladelfiy', 'Pensilvaniy', 1526006],
['Feniks', 'Arizona', 1445632],
['Chicago', 'Ilynois', 2695598]
];
$summary = [];
foreach ($usa as $item){
$state = $item[1];
$peoples = $item[2];
if(array_key_exists($state, $summary)){
$summary[$state] += $peoples;
} else {
$summary[$state] = $peoples;
}
}
print_r($summary);