If a state decides to do that, they are perfectly free to do so. Nebraska and Maine select their electors that way now.
The congressional district method of awarding electoral votes (currently used in Maine and Nebraska) would not help make every vote matter. In NC, for example, there are only 4 of the 13 congressional districts that would be close enough to get any attention from presidential candidates. In California, the presidential race is competitive in only 3 of the state’s 53 districts. A smaller fraction of the country’s population lives in competitive congressional districts (about 12%) than in the current battleground states (about 30%) that now get overwhelming attention, while two-thirds of the states are ignored Also, a second-place candidate could still win the White House without winning the national popular vote.