We construct a semiclassical theory for propagation of an optical wave packet in a nonconducting medium with a periodic structure of dielectric permittivity and magnetic permeability, i.e., a nonconducting photonic crystal. We employ a quantum-mechanical formalism in order to clarify its link to those of electronic systems. It involves the geometrical phase, i.e., Berry's phase, in a natural way, and describes an interplay between orbital motion and internal rotation. Based on the above theory, we discuss the geometrical aspects of the optical Hall effect. We also consider a reduction of the theory to a system without periodic structure and apply it to the transverse shift of an optical beam at an interface reflection or refraction. For a generic incident beam with an arbitrary polarization, an identical result for the transverse shift of each reflected or transmitted beam is given by the following different approaches: (i) analytic evaluation of wave-packet dynamics, (ii) total angular momentum (TAM) conservation for individual photons, and (iii) numerical simulation of wave-packet dynamics. It is consistent with a result by classical electrodynamics. This means that the TAM conservation for individual photons is already taken into account in wave optics, i.e., classical electrodynamics. Finally, we show an application of our theory to a two-dimensional photonic crystal, and propose an optimal design for the enhancement of the optical Hall effect in photonic crystals.