Technically, downloading the game for free from file-hosting sites is considered piracy. Because the game is no longer sold, it is often categorized as "abandonware" by fans, though this has no formal legal standing. How to Play NFS: Most Wanted (2005) Legally
Since you cannot buy it directly from EA, your primary legal options are:
While many users search for "MediaFire" links, these are unofficial. Downloading from these sources carries risks, including malware or corrupted files.
There is no official digital version for sale.