A disk-driven resonance as the origin of high inclinations of close-in planets