Shakespeare's Julius Caesar is virtually an all-male play. Shakespeare must have inserted scenes with female characters just to have some variety. Consider some of Shakespeare's other famous plays. In Macbeth there is a big part for Lady Macbeth and also parts for three (female) witches and for Lady Macduff. In Othello there are good parts for Desdemona and Emelia, with a smaller part for Bianca. In King Lear there are strong parts for Goneril, Regan, and Cordelia. Rosalind has the best part of all in As You Like It. But in Julius Caesar the audience sees nothing but men all dressed in robes, all conspiring with one another and against other men in robes. (The characters are continually addressing one another by their names, because otherwise it would be impossible for the audience to tell them apart.) Then at the end there are men dressed in armor and carrying swords. Even in the scene in which Brutus and Antony both address the plebians, there are only men in the mob because, presumably, women were expected to stay at home. No doubt the scenes involving Portia and Calpurnia, respectively, were created to provide work for the female impersonators in Shakespeare's company and to provide a little variety. The roles of Portia and Calpurnia are not absolutely necessary, since Portia does not succeed in getting Brutus to confide in her and Calpurnia does not succeed in persuading Caesar to stay at home. Calpurnia's role is partially justified by Plutarch, who was Shakespeare's sole source of historical information, but the most of what transpires in Act II.1 comes entirely from Shakespeare's imagination.
The scene takes place in Brutus' garden. He has received letters from anonymous Romans asking him to awaken to the potential tyranny of Caesar. We the audience know that these are planted by Cassius to incite Brutus to join the conspiracy. As Brutus is reading the letters, Cassius, accompanied by other conspirators, comes to speak to Brutus. They persuade Brutus to join them in their assassination to Caesar, for the good of Roman. After the conspirators leave, Portia questions Brutus about his late nights and sleeplessness. She is upset that Brutus won't share his plans with her, and she even cuts herself to show how strong she is (strong enough to bear his burdens with him). We are left to assume that he relays to her the events of that evening.
This scene allows the audience to see Brutus' character. It also sets the stage for Brutus' tragic flaw and allows for a juxtaposition between Brutus and Portia's relationship with Caesar and Calpurnia's later on.