Cartridges were not only an anti piracy move, it saved on cost of console manufacturing (the N64 was still sold at a loss).
As you point out N64 games were originally a lot more expensive than playstation games.
Also Nintendo were really restrictive with who could develop for the N64, remember the whole "dream team" thing? Mean playstation had way more favourable licensing and you didn't need silicon graphics workstations (I think I'm correct in N64 dev requiring them?)