This speech was delivered at the Washington Monument as part of the "March on Washington for Jobs and Freedom". In order to understand the purpose of the speech, you need to be aware of the political situation in the United States at that time.
Martin Luther King Junior was a member of the NAACP (National Association for the Advancement of Colored [sic] People), which used non-violent methods to fight for human and political rights for African American people. His famous Letter from Birmingham Jail provides a clear explanation of the necessity of ensuring justice for all people:
“Injustice anywhere is a threat to justice everywhere. We are caught in an inescapable network of mutuality, tied in a single garment of destiny. Whatever affects one directly, affects all indirectly."(Letter from Birmingham Jail, 1963)
The "I Have a Dream" speech is written in the style of a traditional southern (US) Baptist sermon, and uses imagery, intertextual references to scripture and literature and an array of powerful metaphors to deliver its message: that the only way to ensure a future of peace and success for all people is to ensure that African Americans are granted the rights and freedoms afforded white citizens, and if the whole society works to create an atmosphere of justice and brotherhood.