the reason why traits have to be heritable for evolution to affect them is: Because otherwise the traits could not be passed on
If the traits is not heritable, the genetic traits will extinct as soon as the organism that contains it dies and therefore will prevent any potential evolution from happening.