Act 5, scene 2 is a short, incidental scene in which the Scottish army prepares to lay siege to Macbeth's castle. The characters for the most part speak in blank verse, which is a type of poetry in which each line is written in iambic pentameter. An iamb is a pair of syllables in which the second syllable is stressed. For example, in the line "Of all the gentry: there is Siward's son," the first two syllables, "Of all," form one iamb, the second pair of syllables, "the gent," form a second iamb, and so on. I have highlighted in a bold font the second, stressed syllable of each pair. There are five of these pairs in the line, and so the line is iambic pentameter. The prefix pent is derived from Latin and means five. Because every second syllable is stressed, the lines have an up-down-up-down rhythm, which supposedly mimics the natural rhythm of spoken English. Shakespeare perhaps wrote in this meter, therefore, to help him to create characters who sounded real and authentic.
Another possible reason as to why Shakespeare wrote this scene (and so many others) as poetry is because the rhythms of poetry meant that the lines would have been easier for the actors to memorize.
The characters in this scene are also noble characters, and Shakespeare often distinguished between noble and ignoble characters in his plays by having the former speak in poetry and the latter speak in prose. This could be a third reason as to why Shakespeare decided to write this scene as poetry.