When you pledge allegiance to the flag, you promise loyalty and devotion to your nation.
note: the parts in the () describe the preceding part.

I pledge allegiance
(You promise to be true)

to the flag
(to the emblem of your country)

of the United States of America
(a nation made up of fifty states and several territories, each with certain rights of its own)

and to the republic
(a country where the people elect representatives from among themselves to make laws for them)

for which it stands
(the flag represents the United States of America)

one nation under God,
(a country whose people are free to believe in God)

(the nation cannot be split into parts)

with liberty and justice
(with freedom and fairness)

for all.
(for every person in the country - you and every other American.)