Jesus being twelve at the time was at the age of accountability or coming of age if you prefer. He was setting the standard for all following generations to come in being obedient to ones father and mother. Colonsians 3:20 states "Children, obey your parents in all things: for this is well pleasing unto the Lord."
1 Samuel 7:3 states " Prepare your hearts unto the Lord and serve him only: and he will deliver you out of the land of the Philistines". In comparison to the scriptures we too dwell among the Philistines (The unsaved ) of this world. We are to be obiedient and quick to repent if we should falter. We are the children of God and we were made to serve him daily, we can have no inner peace without serving and obeying him.