Why do some seemingly good works survive judgment while others are burned up?

Motive determines it: works done for self are burned, while works done for God's glory and others' benefit endure as gold, silver, and precious stones.

Watch the Teaching: If God Already Knows Everything, Why Do We Pray?