There are multiple purposes behind the novel structure of Moby-Dick.
In the first instance the author was himself a whaleman, having spent 18 months as an ordinary seaman aboard the whaler Acushnet in 1841–42. In his experience the literature of the day, such as Miriam Coffin or The Whale-Fisherman by Joseph Hart, did not portray whaling accurately but rather sensationalised it. He wished to provide his readers with a more realistic account.
In doing so, he also gave the reader the information necessary to better understand and appreciate the passages of whaling described in the novel. With the reader forewarned, he is able to keep the narrative passages tense and exciting. It is interesting that, early in the novel, the Pequod meets virutally no whales and that the chases become longer and more involved as the story progresses. This may be because Melville felt he needed to give the reader more and more technical information before they could fully appreicate these encounters, but understood the science would need to be spaced out among the narrative.
In describing it to the reader, the science also serves another useful narrative function. It indicates that on whaling voyages, long periods of time pass when nothing much happens at all. By padding out of the story with scientific digressions serves as a useful narrative metaphor for waiting.
The level of detail provided also mirrors one of the novel's central themes: obsession. Although Ishmael is the narrator and Ahab the obvious obsessive, the amount of science indicates that Ishmael is also an obsessive. His obsession is the business of whaling itself.
Finally, Melville made good use of these passages in serving as metaphors for other themes of the novel where he felt it appropriate. For example in the chapter The Line, which describes how the whale line is stored and used in the boat, it ends by using the line as a metaphor.
"All men live enveloped in whale-lines. All are born with halters
round their necks; but it is only when caught in the swift, sudden
turn of death, that mortals realize the silent, subtle, ever-present
perils of life."