Set meta field to publish date + 2 weeks

Try this:

add_action('publish_post', 'dp_expiry');
function dp_expiry( $data ) {
    /*adds 2 weeks onto the current date in unix epoch format*/
$dp_new_expiry_date = (strtotime( current_time( 'mysql' ) ) + 1209600);
        /*converts unix timstamp back to yyyy-mm-dd format like you required*/
    $dp_new_expiry_date_conv = date("Y-m-d", $dp_new_expiry_date);
update_post_meta( $data['post_id'], 'postexpiry', $dp_new_expiry_date_conv );
}