Genesis 38:10

NKJV
And the thing which he did displeased the LORD; therefore He killed him also.