Usually, when writing verses in Tanach Scrolls, words are written across the column from the right margin to the left (except, of course, for required Parsha spacing.)

I have seen two "special" formats:

The "brick" layout, which seems to be reserved for "songs". Examples:

Shirat Hayam (Song of the Sea) in Shemot

Devorah's song in Shoftim (Judges)

David's song in Shmuel II (Samuel II)

The 2 column straight layout. Examples:

Ha'azinu near the end of Sefer Devarim (Deut.)

Words beginning "To everything there is a time" in Kohelet (Ecclessiastes)

List of Haman's 10 sons in Esther

Tehillim, Mishlei, and most of Iyov

The 4 column straight layout. Example (the only one?):

The kings in Yehoshua

What common theme or criteria are used to decide which layout to use for which of these areas?

From what I can tell, the "brick" layout seems to reserved for "songs", though ha'azinu is called a "song" and it has the 2 column layout.

Why are these specific layouts appropriate for these areas? (I.e. - why choose one layout vs. the other?) Why does it get any layout at all? Why not leave the writing straight across as with everything else?

The kings in Yehoshua get a 4 column straight layout.
– HeshySep 17 '18 at 15:25

Using the brick layout for David's song is a modern innovation to make it be more song like. In all old manuscripts and early printings it's two columns like Haazinu. It's really just Devorah and Az Yashir have one type, and everything else is another.
– Double AA♦Sep 17 '18 at 15:44

SA YD 275:3 seems to hold (unless I’m misreading it) that while it’s passul if you write a shirah as an ordinary parshah, it’s kasher if you write it using the wrong shirah format. Take a look at §4-5 where he discusses Shiras HaYam and Shiras Haazinu.
– DonielFSep 17 '18 at 15:45