This post deals with the 924 (Wikipedia entry here). As the entry mentions, the 924 originally was a joint project with Volkswagen. VW wanted a sporty model and Porsche wanted a successor to its entry-level 914. Eventually VW backed out of the project, so Porsche bought the rights and continued. It's the VW (actually, largely Audi) influence that resulted in the front motor configuration.
When 924s were announced in 1977, Porsche purists were somewhat shocked by its configuration and hard-core sports car fans thought the cars were underpowered. The motoring public interested in sporty, not horribly costly cars thought otherwise, and 924s sold well -- to the tune of about 150,000 being built over its 1977-1988 run and they were profitable to Porsche.