A camera module, comprising: a first component-mounting board that includes an imaging device; a second component-mounting board that is electrically connected to the first component-mounting board; and a spacer component that is arranged between the first component-mounting board and the second component-mounting board, the spacer component being a single layer of a component body in the form of a plate or being configured to include a component body and a layer that is formed integrally with the component body and is made of a material of a type that is different from the type of material of the component body, the spacer component including the component body that is made of a first insulating material, the component body including a first primary-surface portion that includes a plurality of first reference surfaces including at least three first reference surfaces, a second primary-surface portion that includes a plurality of second reference surfaces including at least three second reference surfaces, and a component accommodation portion (115, 130) with or without a bottom and serving as an escape portion to prevent interference between the spacer component and electronic components mounted on the front surface of the second component-mounting board, the first primary-surface portion being brought into contact with the first component-mounting board, the second primary-surface portion being brought into contact with the second component-mounting board, the component accommodation portion (115, 130, 133) being provided to at least one of the first primary-surface portion or the second primary-surface portion; wherein the first reference surfaces are formed as planar portions with different shapes and different sizes, and the second reference surfaces are formed as planar portions; wherein the component body further includes a plurality of engagement protrusions (116, 117) that control misalignment between the spacer component and the first component-mounting board, and wherein each of the plurality of engagement protrusions (116, 117) includes: a stem portion (116a, 117a) that is provided to a corresponding one of two side edges of the first primary-surface portion, the two side edges facing each other, and a claw portion (116b, 117b) that is provided to a tip of the stem portion, the claw portion being engaged with a surface of the first component-mounting board that is opposite to a surface of the first component-mounting board that faces the spacer component. a first component-mounting board that includes an imaging device; a second component-mounting board that is electrically connected to the first component-mounting board; and a spacer component that is arranged between the first component-mounting board and the second component-mounting board, the spacer component being a single layer of a component body in the form of a plate or being configured to include a component body and a layer that is formed integrally with the component body and is made of a material of a type that is different from the type of material of the component body, the spacer component including the component body that is made of a first insulating material, the component body including a first primary-surface portion that includes a plurality of first reference surfaces including at least three first reference surfaces, a second primary-surface portion that includes a plurality of second reference surfaces including at least three second reference surfaces, and a component accommodation portion (115, 130) with or without a bottom and serving as an escape portion to prevent interference between the spacer component and electronic components mounted on the front surface of the second component-mounting board, the first primary-surface portion being brought into contact with the first component-mounting board, the second primary-surface portion being brought into contact with the second component-mounting board, the component accommodation portion (115, 130, 133) being provided to at least one of the first primary-surface portion or the second primary-surface portion; wherein the first reference surfaces are formed as planar portions with different shapes and different sizes, and the second reference surfaces are formed as planar portions; wherein the component body further includes a plurality of engagement protrusions (116, 117) that control misalignment between the spacer component and the first component-mounting board, and wherein each of the plurality of engagement protrusions (116, 117) includes: a stem portion (116a, 117a) that is provided to a corresponding one of two side edges of the first primary-surface portion, the two side edges facing each other, and a claw portion (116b, 117b) that is provided to a tip of the stem portion, the claw portion being engaged with a surface of the first component-mounting board that is opposite to a surface of the first component-mounting board that faces the spacer component. a stem portion (116a, 117a) that is provided to a corresponding one of two side edges of the first primary-surface portion, the two side edges facing each other, and a claw portion (116b, 117b) that is provided to a tip of the stem portion, the claw portion being engaged with a surface of the first component-mounting board that is opposite to a surface of the first component-mounting board that faces the spacer component.