Back then the Vice President was a separate election. And the VP was not always of the same party as the president.
The Whigs were trying to appeal to as many people as possible. Tyler was an anti-Jackson Democrat so they put him on the ticket (never expecting William Henry Harrison to die in office). The Republicans made the same mistake in 1864 when Lincoln put Andrew Johnson on the ticket to try to win over War Democrats. Johnson was a Democrat and soon found himself at loggerheads with the Radical Republicans in Congress.