Some materials cannot be replicated. Latinum and dilithium are some examples.
I don't have a problem with that otherwise you'd have an inexhaustible power source.
Dilithium is a moderating element, not a power source. Even in the episode Scotty's removal of the crystals was more akin to a control rod being removed, causing the reactor to stop.
Antimatter still needs to be produced by large and dedicated machines deep in the ship at a cost to it's overall power, or done at intervals from raw space matter or a starbase.
Energy has never been inexhaustible in Trek, which I agree is a good thing.