How important are our thoughts and motives compared to our actions?

Matthew 5:21, Matthew 5:22 and Matthew 5:27-28