Outside of what the Court Rules of California and the local court rules require, there actually is little that restricts the formatting of legal documents. Nonetheless, because lawyers are bound by tradition and are lazy, they just copy and paste ad infinitum and unfortunately carry forward a bunch of bad habits.
This is what the California Rules of Court say regarding formatting.
Trial court documents
The Rules of Court control form and formatting of trial court documents. No local rule can override the Rules of Court.
First, the general rules about the paper itself. White, 8.5 x 11″ paper, 20-pound weight or more. Rules of Court formerly required 30% post-consumer recycled paper, but that rule has been repealed. Use only one side. Two-hole punch it at the top. Bind at the top too.
Now, for what goes on the page. In general, use 12-point font. Only black or blue-black ink can be used. The font should be similar to Courier, Times New Roman, or Arial. The typefaces article discusses which ones to use.
Margins should be at least 1-inch on the left and at least 0.5-inch on the right. According to both Butterick and Robbins, these margins are way too small, creating a line length that is far too long. This is also why Microsoft changed the default page margins in Office 2007 and up to 1.25″. Butterick recommends a page margin of 1.5–2.0 inches. I use 1.5 inches on both sides. With 12-point font, that gives me a maximum line length of about 60–65 characters.
Related to the margins are the vertical lines that go down on the left and the right side of the page. CRC rule 2.108 only requires a line on the left side if less than 1/5″ separates the line numbers from the text. Nothing requires a line on the right side.
Line-spacing is either one-and-half spaced or double-spaced. Footnotes and quotations may be single-spaced. Butterick recommends 1.2–1.45-line spacing, but court rules don't allow that. I go with double-spacing, because I sometimes use single-spaced block quotes, and the line numbers would get thrown off I combined that with one-and-half-spaced.
Line numbers are along the left side and are consecutive. I generally see 28 lines per page, but nothing says you can't have more or less.
Page numbers must be at the bottom of the page, and are consecutive. I've seen some pleadings not have a page number on the caption page. Rule 2.109 seems to indicate to me the caption page should be numbered.
Below the page number is the footer. The footer must be separated from the main text by a horizontal line. The footer is at least 10-point font.
The caption page has a lot of rules associated with it. At the top left of the page, starting with line 1 is the attorney's information. The top right should be blank. At line 8 or at 3⅓″ down should be be the title of the court. Below that should be the the title of the case, meaning the parties. On the right side should be the case number, the nature of the paper, the name of the judge and department.