Motivated by the discovery of prolate rotation of stars in Andromeda II, a dwarf spheroidal companion of M31, we study its origin via mergers of disky dwarf galaxies. We simulate merger events between two identical dwarfs changing the initial inclination of their disks with respect to the orbit and the amount of orbital angular momentum. On radial orbits the amount of prolate rotation in the merger remnants correlates strongly with the inclination of the disks and is well understood as due to the conservation of the angular momentum component of the disks along the merger axis. For non-radial orbits prolate rotation may still be produced if the orbital angular momentum is initially not much larger than the intrinsic angular momentum of the disks. The orbital structure of the remnants with significant rotation is dominated by box orbits in the center and long-axis tubes in the outer parts. The frequency analysis of stellar orbits in the plane perpendicular to the major axis reveals the presence of two families roughly corresponding to inner and outer long-axis tubes. The fraction of inner tubes is largest in the remnant forming from disks oriented most vertically initially and is responsible for the boxy shape of the galaxy. We conclude that prolate rotation results from mergers with a variety of initial conditions and no fine tuning is necessary to reproduce this feature. We compare the properties of our merger remnants to those of dwarfs resulting from the tidal stirring scenario and the data for Andromeda II.