Some things are sins because they are in direct contradiction to God’s law; either doing something God forbids or failing to do what he commands. But this is broader than a simple glance at the Ten Commandments. Any failure to love God with all of ones heart, soul, mind, and strength, or to love our neighbor as our self is sin. To resist God and his will, his truth, his proper worship and so on is sin as well.
Other things, things that may appear to be technically in line with God’s word, can still be sinful when they come from a person who is not in a right relationship with God through Jesus Christ, since without faith it is impossible to please God and whatever does not proceed from faith is sin.