generally, the reaction of a metal with an acid is written as
metal + acid ---->metal salt + hydrogen gas
but this reaction is not true for all metals. it is always true for which are more reactive than hydrogen
in case of copper Copper is below hydrogen in the reactivity series. This means that copper is less reactive than hydrogen and hence cannot displace it from the acidic solution. so, this is the reason copper does not react with hydrochloric acid.